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

Commit

Permalink
Show file tree
Hide file tree
Showing 34 changed files with 0 additions and 313 deletions.
5 changes: 0 additions & 5 deletions src/Config.php
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di;
Expand All @@ -17,9 +16,6 @@

/**
* Configures Di instances
*
* @category Zend
* @package Zend_Di
*/
class Config
{
Expand Down Expand Up @@ -197,5 +193,4 @@ public function configureInstance(Di $di, $instanceData)
}
}
}

}
4 changes: 0 additions & 4 deletions src/Definition/Annotation/Inject.php
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition\Annotation;
Expand All @@ -14,9 +13,6 @@

/**
* Annotation for injection endpoints for dependencies
*
* @category Zend
* @package Zend_Di
*/
class Inject implements AnnotationInterface
{
Expand Down
4 changes: 0 additions & 4 deletions src/Definition/Annotation/Instantiator.php
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition\Annotation;
Expand All @@ -14,9 +13,6 @@

/**
* Annotation for instantiator
*
* @category Zend
* @package Zend_Di
*/
class Instantiator implements AnnotationInterface
{
Expand Down
5 changes: 0 additions & 5 deletions src/Definition/ArrayDefinition.php
Expand Up @@ -5,16 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition;

/**
* Class definitions based on a given array
*
* @category Zend
* @package Zend_Di
*/
class ArrayDefinition implements DefinitionInterface
{
Expand Down Expand Up @@ -166,5 +162,4 @@ public function toArray()
{
return $this->dataArray;
}

}
5 changes: 0 additions & 5 deletions src/Definition/Builder/InjectionMethod.php
Expand Up @@ -5,16 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition\Builder;

/**
* Definitions for an injection endpoint method
*
* @category Zend
* @package Zend_Di
*/
class InjectionMethod
{
Expand Down Expand Up @@ -73,5 +69,4 @@ public function getParameters()
{
return $this->parameters;
}

}
5 changes: 0 additions & 5 deletions src/Definition/Builder/PhpClass.php
Expand Up @@ -5,16 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition\Builder;

/**
* Object containing definitions for a single class
*
* @category Zend
* @package Zend_Di
*/
class PhpClass
{
Expand Down Expand Up @@ -176,5 +172,4 @@ public function getInjectionMethods()
{
return $this->injectionMethods;
}

}
5 changes: 0 additions & 5 deletions src/Definition/BuilderDefinition.php
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition;
Expand All @@ -14,9 +13,6 @@

/**
* Class definitions based on a configuration array
*
* @category Zend
* @package Zend_Di
*/
class BuilderDefinition implements DefinitionInterface
{
Expand Down Expand Up @@ -322,5 +318,4 @@ public function getMethodParameters($class, $method)

return $methodParameters;
}

}
4 changes: 0 additions & 4 deletions src/Definition/ClassDefinition.php
Expand Up @@ -5,16 +5,12 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition;

/**
* Class definitions for a single class
*
* @category Zend
* @package Zend_Di
*/
class ClassDefinition implements DefinitionInterface, PartialMarker
{
Expand Down
159 changes: 0 additions & 159 deletions src/Definition/CompilerDefinition.php
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition;
Expand All @@ -20,9 +19,6 @@

/**
* Class definitions based on a set of directories to be scanned
*
* @category Zend
* @package Zend_Di
*/
class CompilerDefinition implements DefinitionInterface
{
Expand Down Expand Up @@ -304,161 +300,6 @@ protected function processParams(&$def, Reflection\ClassReflection $rClass, Refl

}

// public function processClass($className)
// {
// $strategy = $this->introspectionStrategy;
// $sClass = $this->directoryScanner->getClass($className, true, true);
//
// if (!$sClass->isInstantiable()) {
// return;
// }
//
// // determine supertypes
// $superTypes = array();
// if (($parentClasses = $sClass->getParentClasses()) !== null) {
// $superTypes = array_merge($superTypes, $parentClasses);
// }
// if (($interfaces = $sClass->getInterfaces())) {
// $superTypes = array_merge($superTypes, $interfaces);
// }
//
// $className = $sClass->getName();
// $this->classes[$className] = array(
// 'supertypes' => $superTypes,
// 'instantiator' => null,
// 'methods' => array(),
// 'parameters' => array()
// );
//
// $def = &$this->classes[$className];
//
// if ($def['instantiator'] == null) {
// if ($sClass->isInstantiable()) {
// $def['instantiator'] = '__construct';
// }
// }
//
// if ($sClass->hasMethod('__construct')) {
// $mScanner = $sClass->getMethod('__construct');
// if ($mScanner->isPublic() && $mScanner->getNumberOfParameters() > 0) {
// $def['methods']['__construct'] = true;
// $this->processParams($def, $sClass, $mScanner);
// }
// }
//
// foreach ($sClass->getMethods(true) as $mScanner) {
// if (!$mScanner->isPublic()) {
// continue;
// }
//
// $methodName = $mScanner->getName();
//
// if ($mScanner->getName() === '__construct') {
// continue;
// }
//
// if ($strategy->getUseAnnotations() == true) {
//
// $annotations = $mScanner->getAnnotations($strategy->getAnnotationManager());
//
// if (($annotations instanceof AnnotationCollection)
// && $annotations->hasAnnotation('Zend\Di\Definition\Annotation\Inject')) {
//
// $def['methods'][$methodName] = true;
// $this->processParams($def, $sClass, $mScanner);
// continue;
// }
// }
//
// $methodPatterns = $this->introspectionStrategy->getMethodNameInclusionPatterns();
//
// // matches a method injection pattern?
// foreach ($methodPatterns as $methodInjectorPattern) {
// preg_match($methodInjectorPattern, $methodName, $matches);
// if ($matches) {
// $def['methods'][$methodName] = false; // check ot see if this is required?
// $this->processParams($def, $sClass, $mScanner);
// continue 2;
// }
// }
//
// }
//
// $interfaceInjectorPatterns = $this->introspectionStrategy->getInterfaceInjectionInclusionPatterns();
//
// // matches the interface injection pattern
// /** @var $sInterface \Zend\Code\Scanner\ClassScanner */
// foreach ($sClass->getInterfaces(true) as $sInterface) {
// foreach ($interfaceInjectorPatterns as $interfaceInjectorPattern) {
// preg_match($interfaceInjectorPattern, $sInterface->getName(), $matches);
// if ($matches) {
// foreach ($sInterface->getMethods(true) as $sMethod) {
// if ($sMethod->getName() === '__construct') {
// constructor not allowed in interfaces
// continue;
// }
// $def['methods'][$sMethod->getName()] = true;
// $this->processParams($def, $sClass, $sMethod);
// }
// continue 2;
// }
// }
// }
//
// }
//
// protected function processParams(&$def, DerivedClassScanner $sClass, MethodScanner $sMethod)
// {
// if (count($sMethod->getParameters()) === 0) {
// return;
// }
//
// $methodName = $sMethod->getName();
//
// $def['parameters'][$methodName] = array();
//
// foreach ($sMethod->getParameters(true) as $position => $p) {
//
// /** @var $p \Zend\Code\Scanner\ParameterScanner */
// $actualParamName = $p->getName();
//
// $paramName = $this->createDistinctParameterName($actualParamName, $sClass->getName());
//
// $fqName = $sClass->getName() . '::' . $sMethod->getName() . ':' . $position;
//
// $def['parameters'][$methodName][$fqName] = array();
//
// // set the class name, if it exists
// $def['parameters'][$methodName][$fqName][] = $actualParamName;
// $def['parameters'][$methodName][$fqName][] = ($p->getClass() !== null) ? $p->getClass() : null;
// $def['parameters'][$methodName][$fqName][] = !$p->isOptional();
// }
// }
//
// protected function createDistinctParameterName($paramName, $class)
// {
// $currentParams = array();
// if ($this->classes[$class]['parameters'] === array()) {
// return $paramName;
// }
// foreach ($this->classes as $cdata) {
// foreach ($cdata['parameters'] as $mdata) {
// $currentParams = array_merge($currentParams, array_keys($mdata));
// }
// }
//
// if (!in_array($paramName, $currentParams)) {
// return $paramName;
// }
//
// $alt = 2;
// while (in_array($paramName . (string) $alt, $currentParams)) {
// $alt++;
// }
//
// return $paramName . (string) $alt;
// }

/**
* {@inheritDoc}
*/
Expand Down
5 changes: 0 additions & 5 deletions src/Definition/DefinitionInterface.php
Expand Up @@ -5,15 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition;

/**
* @category Zend
* @package Zend_Di
*/
interface DefinitionInterface
{
/**
Expand Down
5 changes: 0 additions & 5 deletions src/Definition/IntrospectionStrategy.php
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
*/

namespace Zend\Di\Definition;
Expand All @@ -16,9 +15,6 @@
/**
* Strategy used to discover methods to be considered as endpoints for dependency injection based on implemented
* interfaces, annotations and method names
*
* @category Zend
* @package Zend_Di
*/
class IntrospectionStrategy
{
Expand Down Expand Up @@ -136,5 +132,4 @@ public function getInterfaceInjectionInclusionPatterns()
{
return $this->interfaceInjectionInclusionPatterns;
}

}

0 comments on commit 7e77c89

Please sign in to comment.