Skip to content

Commit 6455f89

Browse files
author
silinmykola
committed
Change usage call_user_func_array function for php8 comptatibility
1 parent fb5aa1c commit 6455f89

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

app/code/Magento/Config/Console/Command/EmulatedAdminhtmlAreaProcessor.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Config\Console\Command;
77

8+
use Exception;
89
use Magento\Framework\App\Area;
910
use Magento\Framework\App\State;
1011
use Magento\Framework\Config\ScopeInterface;
@@ -48,17 +49,18 @@ public function __construct(ScopeInterface $scope, State $state)
4849
* @param array $params The parameters to be passed to the callback, as an indexed array
4950
* @return bool|int|float|string|array|null - as the result of this method is the result of callback,
5051
* you can use callback only with specified in this method return types
51-
* @throws \Exception The exception is thrown if the parameter $callback throws an exception
52+
* @throws Exception The exception is thrown if the parameter $callback throws an exception
5253
*/
5354
public function process(callable $callback, array $params = [])
5455
{
5556
$currentScope = $this->scope->getCurrentScope();
5657
try {
5758
return $this->state->emulateAreaCode(Area::AREA_ADMINHTML, function () use ($callback, $params) {
5859
$this->scope->setCurrentScope(Area::AREA_ADMINHTML);
59-
return call_user_func_array($callback, $params);
60+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
61+
return call_user_func_array($callback, array_values($params));
6062
});
61-
} catch (\Exception $exception) {
63+
} catch (Exception $exception) {
6264
throw $exception;
6365
} finally {
6466
$this->scope->setCurrentScope($currentScope);

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ public function walkAttributes($partMethod, array $args = [], $collectExceptionM
677677

678678
try {
679679
// phpcs:disable Magento2.Functions.DiscouragedFunction
680-
$results[$attrCode] = call_user_func_array([$instance, $method], $args);
680+
$results[$attrCode] = call_user_func_array([$instance, $method], array_values($args));
681681
} catch (\Magento\Eav\Model\Entity\Attribute\Exception $e) {
682682
if ($collectExceptionMessages) {
683683
$results[$attrCode] = $e->getMessage();

app/code/Magento/Indexer/Model/Indexer/DependencyDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct(
6565
public function __call(string $method, array $args)
6666
{
6767
//phpcs:ignore Magento2.Functions.DiscouragedFunction
68-
return call_user_func_array([$this->indexer, $method], $args);
68+
return call_user_func_array([$this->indexer, $method], array_values($args));
6969
}
7070

7171
/**

0 commit comments

Comments
 (0)