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();