From 059d72a203d83c0e3d5d26085567d914415601b8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 2 Oct 2020 16:48:58 +0200 Subject: [PATCH] fix named parameters confusion with PHP 8 fix is_callable call, failing with PHP8 for non-static method x --- src/Bartlett/CompatInfo/Console/CommandFactory.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bartlett/CompatInfo/Console/CommandFactory.php b/src/Bartlett/CompatInfo/Console/CommandFactory.php index fdbb6938..673421cf 100644 --- a/src/Bartlett/CompatInfo/Console/CommandFactory.php +++ b/src/Bartlett/CompatInfo/Console/CommandFactory.php @@ -318,7 +318,7 @@ function (GenericEvent $event) use ($progress) { try { $response = call_user_func_array( array($api, $methodName), - $args + array_values($args) ); } catch (\Exception $e) { $response = $e; @@ -363,8 +363,9 @@ function (GenericEvent $event) use ($progress) { return; } - if (!method_exists($outputFormatter, $methodName) - || !is_callable(array($outputFormatter, $methodName)) + $result = new $outputFormatter(); + if (!method_exists($result, $methodName) + || !is_callable(array($result, $methodName)) || $output->isDebug() ) { $style = 'debug'; @@ -375,7 +376,6 @@ function (GenericEvent $event) use ($progress) { return; } - $result = new $outputFormatter(); if ($response instanceof Profile) { $data = $response->getData();