Permalink
Browse files

[zen-27] Renamed interfaces in Zend\Di

  • Loading branch information...
1 parent 350de78 commit 01936a58e2b518afe3ab38713b36e2e37c1eef65 @prolic prolic committed May 6, 2012
Showing with 87 additions and 103 deletions.
  1. +1 −1 documentation/manual/en/module_specs/Zend_Di-Definitions.xml
  2. +2 −2 documentation/manual/en/module_specs/Zend_Mvc-Controllers.xml
  3. +1 −1 documentation/manual/en/module_specs/Zend_Mvc-Intro.xml
  4. +1 −1 documentation/manual/it/module_specs/Zend_Di-Definitions.xml
  5. +2 −2 documentation/manual/it/module_specs/Zend_Mvc-Controllers.xml
  6. +1 −1 documentation/manual/it/module_specs/Zend_Mvc-Intro.xml
  7. +1 −1 library/Zend/Di/Definition/ArrayDefinition.php
  8. +1 −1 library/Zend/Di/Definition/BuilderDefinition.php
  9. +1 −1 library/Zend/Di/Definition/ClassDefinition.php
  10. +1 −1 library/Zend/Di/Definition/CompilerDefinition.php
  11. +1 −1 library/Zend/Di/Definition/{Definition.php → DefinitionInterface.php}
  12. +1 −1 library/Zend/Di/Definition/RuntimeDefinition.php
  13. +11 −11 library/Zend/Di/DefinitionList.php
  14. +1 −1 library/Zend/Di/{DependencyInjection.php → DependencyInjectionInterface.php}
  15. +1 −1 library/Zend/Di/Di.php
  16. +0 −6 library/Zend/Di/Exception.php
  17. +2 −3 library/Zend/Di/Exception/CircularDependencyException.php
  18. +2 −3 library/Zend/Di/Exception/ClassNotFoundException.php
  19. +6 −0 library/Zend/Di/Exception/ExceptionInterface.php
  20. +3 −5 library/Zend/Di/Exception/InvalidArgumentException.php
  21. +1 −5 library/Zend/Di/Exception/InvalidParamNameException.php
  22. +1 −5 library/Zend/Di/Exception/InvalidPositionException.php
  23. +2 −3 library/Zend/Di/Exception/MissingPropertyException.php
  24. +1 −3 library/Zend/Di/Exception/RuntimeException.php
  25. +2 −3 library/Zend/Di/Exception/UndefinedReferenceException.php
  26. +1 −1 library/Zend/Di/InstanceManager.php
  27. +1 −1 library/Zend/Di/{Locator.php → LocatorInterface.php}
  28. +1 −1 library/Zend/Di/ServiceLocator.php
  29. +2 −2 library/Zend/Di/ServiceLocator/Generator.php
  30. +1 −1 library/Zend/Di/{ServiceLocation.php → ServiceLocatorInterface.php}
  31. +2 −2 library/Zend/Loader/LocatorAware.php
  32. +5 −5 library/Zend/Loader/PluginBroker.php
  33. +4 −4 library/Zend/Mvc/AppContext.php
  34. +4 −4 library/Zend/Mvc/Application.php
  35. +1 −1 library/Zend/Mvc/Bootstrap.php
  36. +4 −4 library/Zend/Mvc/Controller/ActionController.php
  37. +3 −3 library/Zend/Mvc/Controller/Plugin/Forward.php
  38. +4 −4 library/Zend/Mvc/Controller/RestfulController.php
  39. +2 −2 library/Zend/Mvc/LocatorAware.php
  40. +1 −1 tests/Zend/Di/Definition/BuilderDefinitionTest.php
  41. +2 −2 tests/Zend/Loader/TestAsset/ServiceLocator.php
  42. +1 −1 tests/Zend/Mvc/TestAsset/Locator.php
  43. +1 −1 tests/Zend/Mvc/TestAsset/LocatorAwareController.php
@@ -173,7 +173,7 @@ protected function setupDi(Application $app)
$runtime = new Definition\RuntimeDefinition(),
));
$di = new Di($definitionList, null, new Configuration($this->config->di));
- $di->instanceManager()->addTypePreference('Zend\Di\Locator', $di);
+ $di->instanceManager()->addTypePreference('Zend\Di\LocatorInterface', $di);
$app->setLocator($di);
}
]]></programlisting>
@@ -112,9 +112,9 @@ public function getEvent($event);
</para>
<programlisting language="php"><![CDATA[
-use Zend\Di\Locator;
+use Zend\Di\LocatorInterface;
-public function setLocator(Locator $locator);
+public function setLocator(LocatorInterface $locator);
public function getLocator($locator);
]]></programlisting>
</section>
@@ -20,7 +20,7 @@
<listitem>
<para>
<classname>Zend\Di</classname>, specifically its
- <classname>Locator</classname> interface, but by default the dependency
+ <classname>LocatorInterface</classname> interface, but by default the dependency
injection container
</para>
</listitem>
@@ -180,7 +180,7 @@ protected function setupDi(Application $app)
$runtime = new Definition\RuntimeDefinition(),
));
$di = new Di($definitionList, null, new Configuration($this->config->di));
- $di->instanceManager()->addTypePreference('Zend\Di\Locator', $di);
+ $di->instanceManager()->addTypePreference('Zend\Di\LocatorInterface', $di);
$app->setLocator($di);
}
]]></programlisting>
@@ -113,9 +113,9 @@ public function getEvent($event);
</para>
<programlisting language="php"><![CDATA[
-use Zend\Di\Locator;
+use Zend\Di\LocatorInterface;
-public function setLocator(Locator $locator);
+public function setLocator(LocatorInterface $locator);
public function getLocator($locator);
]]></programlisting>
</section>
@@ -20,7 +20,7 @@
<listitem>
<para>
<classname>Zend\Di</classname>, nello specifico la sua
- interfaccia <classname>Locator</classname>, comunque
+ interfaccia <classname>LocatorInterface</classname>, comunque
il Dependency Injection Container (DiC).
</para>
</listitem>
@@ -2,7 +2,7 @@
namespace Zend\Di\Definition;
-class ArrayDefinition implements Definition
+class ArrayDefinition implements DefinitionInterface
{
protected $dataArray = array();
@@ -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();
@@ -2,7 +2,7 @@
namespace Zend\Di\Definition;
-class ClassDefinition implements Definition, PartialMarker
+class ClassDefinition implements DefinitionInterface, PartialMarker
{
protected $class = null;
@@ -12,7 +12,7 @@
Zend\Code\Reflection,
Zend\Code\Annotation\AnnotationCollection;
-class CompilerDefinition implements Definition
+class CompilerDefinition implements DefinitionInterface
{
protected $isCompiled = false;
@@ -2,7 +2,7 @@
namespace Zend\Di\Definition;
-interface Definition
+interface DefinitionInterface
{
/**
* @abstract
@@ -7,7 +7,7 @@
Zend\Code\Annotation\AnnotationCollection,
Zend\Code\Reflection;
-class RuntimeDefinition implements Definition
+class RuntimeDefinition implements DefinitionInterface
{
/**
@@ -4,7 +4,7 @@
use SplDoublyLinkedList;
-class DefinitionList extends SplDoublyLinkedList implements Definition\Definition
+class DefinitionList extends SplDoublyLinkedList implements Definition\DefinitionInterface
{
public function __construct($definitions)
@@ -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);
@@ -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;
@@ -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());
}
@@ -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;
@@ -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));
}
@@ -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);
@@ -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) {
@@ -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) {
@@ -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)) {
@@ -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);
@@ -2,7 +2,7 @@
namespace Zend\Di;
-interface DependencyInjection extends Locator
+interface DependencyInjectionInterface extends LocatorInterface
{
/**
* Retrieve a new instance of a class
@@ -2,7 +2,7 @@
namespace Zend\Di;
-class Di implements DependencyInjection
+class Di implements DependencyInjectionInterface
{
/**
* @var DefinitionList
@@ -1,6 +0,0 @@
-<?php
-namespace Zend\Di;
-
-interface Exception
-{
-}
@@ -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
{
}
@@ -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
{
}
@@ -0,0 +1,6 @@
+<?php
+namespace Zend\Di\Exception;
+
+interface ExceptionInterface
+{
+}
@@ -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
{
}
@@ -1,10 +1,6 @@
<?php
namespace Zend\Di\Exception;
-use Zend\Di\Exception;
-
-class InvalidParamNameException
- extends InvalidArgumentException
- implements Exception
+class InvalidParamNameException extends InvalidArgumentException
{
}
@@ -1,10 +1,6 @@
<?php
namespace Zend\Di\Exception;
-use Zend\Di\Exception;
-
-class InvalidPositionException
- extends InvalidArgumentException
- implements Exception
+class InvalidPositionException extends InvalidArgumentException
{
}
@@ -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
{
}
@@ -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
{
}
@@ -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,7 +2,7 @@
namespace Zend\Di;
-class InstanceManager /* implements InstanceCollection */
+class InstanceManager /* implements InstanceManagerInterface */
{
/**
* Array of shared instances
@@ -1,7 +1,7 @@
<?php
namespace Zend\Di;
-interface Locator
+interface LocatorInterface
{
/**
* Retrieve a class instance
@@ -2,7 +2,7 @@
namespace Zend\Di;
-class ServiceLocator implements ServiceLocation
+class ServiceLocator implements ServiceLocatorInterface
{
/**
* Map of service names to methods
@@ -4,7 +4,7 @@
use Zend\Di\Di,
Zend\CodeGenerator\Php as CodeGen,
- Zend\Di\DependencyInjection,
+ Zend\Di\DependencyInjectionInterface,
Zend\Di\Exception;
class Generator
@@ -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)
@@ -1,7 +1,7 @@
<?php
namespace Zend\Di;
-interface ServiceLocation extends Locator
+interface ServiceLocatorInterface extends LocatorInterface
{
public function set($name, $service);
}
Oops, something went wrong.

0 comments on commit 01936a5

Please sign in to comment.