Skip to content

Commit

Permalink
Merge pull request #282 from remicollet/issue-php8rc1
Browse files Browse the repository at this point in the history
fix named parameters confusion with PHP 8
  • Loading branch information
llaville authored Oct 2, 2020
2 parents 47c9389 + 059d72a commit 28974d6
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 28974d6

Please sign in to comment.