Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions library/Zend/Di/Di.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ public function get($name, array $params = array())
return $im->getSharedInstance($name, $callParameters);
}


$config = $im->getConfig($name);
$instance = $this->newInstance($name, $params, $config['shared']);
array_pop($this->instanceContext);
Expand Down Expand Up @@ -412,7 +411,7 @@ protected function handleInjectDependencies($instance, $injectionMethods, $param
} elseif (is_int($injectName) && is_array($injectValue)) {
throw new Exception\RuntimeException(
'An injection was provided with a keyed index and an array of data, try using'
. ' the name of a particular method as a key for your injection data.'
. ' the name of a particular method as a key for your injection data.'
);
}
}
Expand Down Expand Up @@ -441,7 +440,7 @@ protected function handleInjectDependencies($instance, $injectionMethods, $param
}
if ($methodsToCall) {
foreach ($methodsToCall as $methodInfo) {
$this->resolveAndCallInjectionMethodForInstance($instance, $methodInfo['method'], $methodInfo['args'], $instanceAlias, self::METHOD_IS_REQUIRED, $instanceClass);
$this->resolveAndCallInjectionMethodForInstance($instance, $methodInfo['method'], $methodInfo['args'], $instanceAlias, self::METHOD_IS_REQUIRED, $instanceClass);
}
}
}
Expand Down Expand Up @@ -626,7 +625,7 @@ protected function resolveMethodParameters($class, $method, array $callTimeUserP
if (array_key_exists('parameters', $iConfig['requestedClass'])) {
$newParameters = array();

foreach ($iConfig['requestedClass']['parameters'] as $name=>$parameter) {
foreach ($iConfig['requestedClass']['parameters'] as $name => $parameter) {
$newParameters[$requestedClass.'::'.$method.'::'.$name] = $parameter;
}

Expand Down Expand Up @@ -817,12 +816,14 @@ protected function resolveMethodParameters($class, $method, array $callTimeUserP
}
// if this item was marked strict,
// plus it cannot be resolve, and no value exist, bail out
throw new Exception\MissingPropertyException(sprintf(
'Missing %s for parameter ' . $name . ' for ' . $class . '::' . $method,
(($value[0] === null) ? 'value' : 'instance/object' )
),
$e->getCode(),
$e);
throw new Exception\MissingPropertyException(
sprintf(
'Missing %s for parameter ' . $name . ' for ' . $class . '::' . $method,
(($value[0] === null) ? 'value' : 'instance/object')
),
$e->getCode(),
$e
);
} else {
//finally ( be aware to do at the end of flow)
array_pop($this->currentDependencies);
Expand All @@ -841,12 +842,14 @@ protected function resolveMethodParameters($class, $method, array $callTimeUserP
}
// if this item was marked strict,
// plus it cannot be resolve, and no value exist, bail out
throw new Exception\MissingPropertyException(sprintf(
'Missing %s for parameter ' . $name . ' for ' . $class . '::' . $method,
(($value[0] === null) ? 'value' : 'instance/object' )
),
$e->getCode(),
$e);
throw new Exception\MissingPropertyException(
sprintf(
'Missing %s for parameter ' . $name . ' for ' . $class . '::' . $method,
(($value[0] === null) ? 'value' : 'instance/object')
),
$e->getCode(),
$e
);
} else {
//finally ( be aware to do at the end of flow)
array_pop($this->currentDependencies);
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Di/InstanceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ public function getClasses()
$classes = array();
foreach ($this->configurations as $name => $data) {
if (strpos($name, 'alias') === 0) {
continue;
continue;
}

$classes[] = $name;
}

Expand Down