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

Commit

Permalink
Merge branch 'master' into hotfix/ZF-3821
Browse files Browse the repository at this point in the history
Conflicts:
	tests/Zend/InfoCard/XmlParsingTest.php
  • Loading branch information
Pádraic Brady committed Aug 26, 2011
12 parents 9a9f950 + 47a731a + 0967316 + 37f548b + 0df2db0 + e43587e + 5784352 + 93b4f40 + 3208a48 + f5dfded + 8301af5 + b38b581 commit d4a4329
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 73 deletions.
64 changes: 48 additions & 16 deletions src/Definition/RuntimeDefinition.php
Expand Up @@ -6,22 +6,44 @@

class RuntimeDefinition implements Definition
{
/**@#+
* @const string Lookup Type
*/
const LOOKUP_TYPE_IMPLICIT = 'implicit';
const LOOKUP_TYPE_EXPLICIT = 'explicit';

/**
* @var string Initial lookup type
*/
protected $lookupType = self::LOOKUP_TYPE_IMPLICIT;


/**
* @var IntrospectionRuleset
*/
protected $introspectionRuleset = null;


/**
* @var array
*/
protected $classes = array();


/**
* @var array
*/
protected $injectionMethodCache = array();


/**
* @param string $lookupType
*/
public function __construct($lookupType = self::LOOKUP_TYPE_IMPLICIT)
{
$this->lookupType = $lookupType;
}


/**
* @param IntrospectionRuleset $introspectionRuleset
* @return void
*/
public function setIntrospectionRuleset(IntrospectionRuleset $introspectionRuleset)
{
$this->introspectionRuleset = $introspectionRuleset;
Expand Down Expand Up @@ -60,7 +82,7 @@ public function setLookupType($lookupType)

/**
* Track classes when using EXPLICIT lookups
* @param unknown_type $class
* @param string $class
*/
public function addClass($class)
{
Expand All @@ -69,7 +91,8 @@ public function addClass($class)

/**
* Return whether the class exists
*
*
* @param string $class
* @return bool
*/
public function hasClass($class)
Expand All @@ -79,7 +102,8 @@ public function hasClass($class)

/**
* Return the supertypes for this class
*
*
* @param string $class
* @return array of types
*/
public function getClassSupertypes($class)
Expand All @@ -89,6 +113,8 @@ public function getClassSupertypes($class)

/**
* Get the instiatiator
*
* @param string $class
* @return string|callable
*/
public function getInstantiator($class)
Expand All @@ -102,7 +128,8 @@ public function getInstantiator($class)

/**
* Return if there are injection methods
*
*
* @param string $class
* @return bool
*/
public function hasInjectionMethods($class)
Expand All @@ -113,7 +140,9 @@ public function hasInjectionMethods($class)

/**
* Return injection methods
*
*
* @param string $class
* @param string $method
* @return bool
*/
public function hasInjectionMethod($class, $method)
Expand All @@ -124,7 +153,8 @@ public function hasInjectionMethod($class, $method)

/**
* Return an array of the injection methods
*
*
* @param string $class
* @return array
*/
public function getInjectionMethods($class)
Expand Down Expand Up @@ -177,7 +207,7 @@ public function getInjectionMethods($class)
continue;
}

// explicity NOT in excluded classes
// explicitly NOT in excluded classes
if ($sRules['excludedClasses']
&& (in_array($className, $sRules['excludedClasses'])
|| in_array($declaringClassName, $sRules['excludedClasses']))) {
Expand Down Expand Up @@ -228,13 +258,15 @@ public function getInjectionMethods($class)

/**
* Return the parameters for a method
*
*
* 3 item array:
* #1 - Class name, string if it exists, else null
* #2 - Optional?, boolean
* #3 - Instantiable, boolean if class exists, otherwise null
*
* @return array
*
* @param string $class
* @param string $method
* @return array
*/
public function getInjectionMethodParameters($class, $method)
{
Expand Down Expand Up @@ -264,7 +296,7 @@ public function getInjectionMethodParameters($class, $method)

$params[$paramName] = array();

// set the clas name, if it exists
// set the class name, if it exists
$params[$paramName][] = ($pc !== null) ? $pc->getName() : null;

// optional?
Expand Down

0 comments on commit d4a4329

Please sign in to comment.