Skip to content

Commit

Permalink
fix named parameters confusion with PHP 8
Browse files Browse the repository at this point in the history
fix is_callable call, failing with PHP8 for non-static method

x
  • Loading branch information
remicollet committed Oct 2, 2020
1 parent 47c9389 commit 059d72a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Bartlett/CompatInfo/Console/CommandFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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';
Expand All @@ -375,7 +376,6 @@ function (GenericEvent $event) use ($progress) {
return;
}

$result = new $outputFormatter();

if ($response instanceof Profile) {
$data = $response->getData();
Expand Down

0 comments on commit 059d72a

Please sign in to comment.