Skip to content

Commit afc5f7c

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-33080' into MAGETWO-33080
2 parents 618dd7b + 03ccdb0 commit afc5f7c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

lib/internal/Magento/Framework/App/ObjectManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function setInstance(\Magento\Framework\ObjectManagerInterface $ob
5353
public function __construct(
5454
FactoryInterface $factory,
5555
\Magento\Framework\ObjectManager\ConfigInterface $config,
56-
array $sharedInstances = []
56+
array &$sharedInstances = []
5757
) {
5858
parent::__construct($factory, $config, $sharedInstances);
5959
self::$_instance = $this;

lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public function getConstructorArgumentTypes(\ReflectionClass $class, $inherited
6464
}
6565
$arguments = explode(',', $arguments);
6666
foreach ($arguments as $key => &$argument) {
67-
$argument = $this->removeDefaultValue($argument);
67+
$argument = $this->removeToken($argument, '=');
68+
$argument = $this->removeToken($argument, '&');
6869
$argument = $this->resolveNamespaces($argument, $availableNamespaces);
6970
}
7071
unset($argument);
@@ -102,11 +103,12 @@ protected function resolveNamespaces($argument, $availableNamespaces)
102103
* Remove default value from argument.
103104
*
104105
* @param string $argument
106+
* @param string $token
105107
* @return string
106108
*/
107-
protected function removeDefaultValue($argument)
109+
protected function removeToken($argument, $token)
108110
{
109-
$position = strpos($argument, '=');
111+
$position = strpos($argument, $token);
110112
if (is_numeric($position)) {
111113
return substr($argument, 0, $position);
112114
}

lib/internal/Magento/Framework/ObjectManager/ObjectManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ObjectManager implements \Magento\Framework\ObjectManagerInterface
3636
* @param ConfigInterface $config
3737
* @param array &$sharedInstances
3838
*/
39-
public function __construct(FactoryInterface $factory, ConfigInterface $config, array &$sharedInstances)
39+
public function __construct(FactoryInterface $factory, ConfigInterface $config, &$sharedInstances = [])
4040
{
4141
$this->_config = $config;
4242
$this->_factory = $factory;

0 commit comments

Comments
 (0)