Skip to content

Commit

Permalink
[PHP 7] Fixed reference issue in ConfigurationProcessor
Browse files Browse the repository at this point in the history
References behave differently in PHP 7 and calls to
`call_user_func_array()` now must have explicit references when passing
arguments (not variables assigned by reference).

See [reported PHP bug](https://bugs.php.net/bug.php?id=70379).
Tests should have broken but they did not because of a issue in
`testMapConfigClosure()`.
  • Loading branch information
lolautruche committed Aug 31, 2015
1 parent cbb4894 commit 393e75e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function mapConfig(array $config, $mapper)
$scopeNodeName = $this->contextualizer->getSiteAccessNodeName();
foreach ($config[$scopeNodeName] as $currentScope => &$scopeSettings) {
if ($mapperCallable) {
call_user_func_array($mapper, array($scopeSettings, $currentScope, $this->contextualizer));
call_user_func_array($mapper, array(&$scopeSettings, $currentScope, $this->contextualizer));
} else {
$mapper->mapConfig($scopeSettings, $currentScope, $this->contextualizer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function testMapConfigClosure()
),
);

$mapperClosure = function (array $scopeSettings, $currentScope, ContextualizerInterface $contextualizer) use ($config, $availableSAs, $saNodeName, $expectedContextualizer) {
$mapperClosure = function (array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer) use ($config, $availableSAs, $saNodeName, $expectedContextualizer) {
self::assertTrue(isset($availableSAs[$currentScope]));
self::assertTrue(isset($config[$saNodeName][$currentScope]));
self::assertSame($config[$saNodeName][$currentScope], $scopeSettings);
Expand Down

0 comments on commit 393e75e

Please sign in to comment.