Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'di-renamed-interfaces' of https://github.com/prolic/zf2
Browse files Browse the repository at this point in the history
…into feature/zen27-di

Conflicts:
	library/Zend/Mvc/Application.php
	library/Zend/Mvc/ApplicationInterface.php
	library/Zend/Mvc/Controller/ActionController.php
	library/Zend/Mvc/Controller/Plugin/Forward.php
	library/Zend/Mvc/Controller/RestfulController.php
  • Loading branch information
Show file tree
Hide file tree
Showing 25 changed files with 46 additions and 62 deletions.
2 changes: 1 addition & 1 deletion src/Definition/ArrayDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Zend\Di\Definition;

class ArrayDefinition implements Definition
class ArrayDefinition implements DefinitionInterface
{

protected $dataArray = array();
Expand Down
2 changes: 1 addition & 1 deletion src/Definition/BuilderDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Zend\Di\Exception;

class BuilderDefinition implements Definition
class BuilderDefinition implements DefinitionInterface
{
protected $defaultClassBuilder = 'Zend\Di\Definition\Builder\PhpClass';
protected $classes = array();
Expand Down
2 changes: 1 addition & 1 deletion src/Definition/ClassDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Zend\Di\Definition;

class ClassDefinition implements Definition, PartialMarker
class ClassDefinition implements DefinitionInterface, PartialMarker
{

protected $class = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Definition/CompilerDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Zend\Code\Reflection,
Zend\Code\Annotation\AnnotationCollection;

class CompilerDefinition implements Definition
class CompilerDefinition implements DefinitionInterface
{
protected $isCompiled = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Zend\Di\Definition;

interface Definition
interface DefinitionInterface
{
/**
* @abstract
Expand Down
2 changes: 1 addition & 1 deletion src/Definition/RuntimeDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Zend\Code\Annotation\AnnotationCollection,
Zend\Code\Reflection;

class RuntimeDefinition implements Definition
class RuntimeDefinition implements DefinitionInterface
{

/**
Expand Down
22 changes: 11 additions & 11 deletions src/DefinitionList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use SplDoublyLinkedList;

class DefinitionList extends SplDoublyLinkedList implements Definition\Definition
class DefinitionList extends SplDoublyLinkedList implements Definition\DefinitionInterface
{

public function __construct($definitions)
Expand All @@ -17,7 +17,7 @@ public function __construct($definitions)
}
}

public function addDefinition(Definition\Definition $definition, $addToBackOfList = true)
public function addDefinition(Definition\DefinitionInterface $definition, $addToBackOfList = true)
{
if ($addToBackOfList) {
$this->push($definition);
Expand Down Expand Up @@ -57,7 +57,7 @@ public function getDefinitionByType($type)

public function getDefinitionForClass($class)
{
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
if ($definition->hasClass($class)) {
return $definition;
Expand All @@ -75,7 +75,7 @@ public function forClass($class)
public function getClasses()
{
$classes = array();
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
$classes = array_merge($classes, $definition->getClasses());
}
Expand All @@ -84,7 +84,7 @@ public function getClasses()

public function hasClass($class)
{
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
if ($definition->hasClass($class)) {
return true;
Expand All @@ -96,7 +96,7 @@ public function hasClass($class)
public function getClassSupertypes($class)
{
$supertypes = array();
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
$supertypes = array_merge($supertypes, $definition->getClassSupertypes($class));
}
Expand All @@ -106,7 +106,7 @@ public function getClassSupertypes($class)

public function getInstantiator($class)
{
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
if ($definition->hasClass($class)) {
$value = $definition->getInstantiator($class);
Expand All @@ -122,7 +122,7 @@ public function getInstantiator($class)

public function hasMethods($class)
{
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
if ($definition->hasClass($class)) {
if ($definition->hasMethods($class) === false && $definition instanceof Definition\PartialMarker) {
Expand All @@ -137,7 +137,7 @@ public function hasMethods($class)

public function hasMethod($class, $method)
{
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
if ($definition->hasClass($class)) {
if ($definition->hasMethods($class) === false && $definition instanceof Definition\PartialMarker) {
Expand All @@ -152,7 +152,7 @@ public function hasMethod($class, $method)

public function getMethods($class)
{
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
$methods = array();
foreach ($this as $definition) {
if ($definition->hasClass($class)) {
Expand All @@ -174,7 +174,7 @@ public function hasMethodParameters($class, $method)

public function getMethodParameters($class, $method)
{
/** @var $definition Definition\Definition */
/** @var $definition Definition\DefinitionInterface */
foreach ($this as $definition) {
if ($definition->hasClass($class) && $definition->hasMethod($class, $method) && $definition->hasMethodParameters($class, $method)) {
return $definition->getMethodParameters($class, $method);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Zend\Di;

interface DependencyInjection extends Locator
interface DependencyInjectionInterface extends LocatorInterface
{
/**
* Retrieve a new instance of a class
Expand Down
2 changes: 1 addition & 1 deletion src/Di.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Zend\Di;

class Di implements DependencyInjection
class Di implements DependencyInjectionInterface
{
/**
* @var DefinitionList
Expand Down
6 changes: 0 additions & 6 deletions src/Exception.php

This file was deleted.

5 changes: 2 additions & 3 deletions src/Exception/CircularDependencyException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php
namespace Zend\Di\Exception;

use Zend\Di\Exception,
DomainException;
use DomainException;

class CircularDependencyException extends DomainException implements Exception
class CircularDependencyException extends DomainException implements ExceptionInterface
{
}
5 changes: 2 additions & 3 deletions src/Exception/ClassNotFoundException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php
namespace Zend\Di\Exception;

use Zend\Di\Exception,
DomainException;
use DomainException;

class ClassNotFoundException extends DomainException implements Exception
class ClassNotFoundException extends DomainException implements ExceptionInterface
{
}
6 changes: 6 additions & 0 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
namespace Zend\Di\Exception;

interface ExceptionInterface
{
}
8 changes: 3 additions & 5 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?php
namespace Zend\Di\Exception;

use Zend\Di\Exception;

class InvalidArgumentException
extends \InvalidArgumentException
implements Exception
class InvalidArgumentException
extends \InvalidArgumentException
implements ExceptionInterface
{
}
6 changes: 1 addition & 5 deletions src/Exception/InvalidParamNameException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?php
namespace Zend\Di\Exception;

use Zend\Di\Exception;

class InvalidParamNameException
extends InvalidArgumentException
implements Exception
class InvalidParamNameException extends InvalidArgumentException
{
}
6 changes: 1 addition & 5 deletions src/Exception/InvalidPositionException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?php
namespace Zend\Di\Exception;

use Zend\Di\Exception;

class InvalidPositionException
extends InvalidArgumentException
implements Exception
class InvalidPositionException extends InvalidArgumentException
{
}
5 changes: 2 additions & 3 deletions src/Exception/MissingPropertyException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php
namespace Zend\Di\Exception;

use Zend\Di\Exception,
DomainException;
use DomainException;

class MissingPropertyException extends DomainException implements Exception
class MissingPropertyException extends DomainException implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php
namespace Zend\Di\Exception;

use Zend\Di\Exception;

class RuntimeException extends \RuntimeException implements Exception
class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}
5 changes: 2 additions & 3 deletions src/Exception/UndefinedReferenceException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php
namespace Zend\Di\Exception;

use Zend\Di\Exception,
DomainException;
use DomainException;

class UndefinedReferenceException extends DomainException implements Exception
class UndefinedReferenceException extends DomainException implements ExceptionInterface
{
}
2 changes: 1 addition & 1 deletion src/InstanceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Zend\Di;

class InstanceManager /* implements InstanceCollection */
class InstanceManager /* implements InstanceManagerInterface */
{
/**
* Array of shared instances
Expand Down
2 changes: 1 addition & 1 deletion src/Locator.php → src/LocatorInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Zend\Di;

interface Locator
interface LocatorInterface
{
/**
* Retrieve a class instance
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Zend\Di;

class ServiceLocator implements ServiceLocation
class ServiceLocator implements ServiceLocatorInterface
{
/**
* Map of service names to methods
Expand Down
4 changes: 2 additions & 2 deletions src/ServiceLocator/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Zend\Di\Di,
Zend\CodeGenerator\Php as CodeGen,
Zend\Di\DependencyInjection,
Zend\Di\DependencyInjectionInterface,
Zend\Di\Exception;

class Generator
Expand All @@ -20,7 +20,7 @@ class Generator
*
* Requires a DependencyInjection manager on which to operate.
*
* @param DependencyInjection $injector
* @param DependencyInjectionInterface $injector
* @return void
*/
public function __construct(Di $injector)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Zend\Di;

interface ServiceLocation extends Locator
interface ServiceLocatorInterface extends LocatorInterface
{
public function set($name, $service);
}
2 changes: 1 addition & 1 deletion test/Definition/BuilderDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BuilderDefinitionTest extends TestCase
public function testBuilderImplementsDefinition()
{
$builder = new BuilderDefinition();
$this->assertInstanceOf('Zend\Di\Definition\Definition', $builder);
$this->assertInstanceOf('Zend\Di\Definition\DefinitionInterface', $builder);
}

public function testBuilderCanBuildClassWithMethods()
Expand Down

0 comments on commit 5f7322a

Please sign in to comment.