Closed pkruithof closed 8 years ago
This is because of Symfony\Component\Console\Command\Command::setCode()
, which changed from
public function setCode($code)
to (
public function setCode(callable $code)
in this commit: https://github.com/symfony/symfony/commit/4e0c6e1b554ac74fee526868b86d028a7c38c10e
This is an example where the SF3 support and PHP 5.3 support don't go together (the callable type hint was introduced in PHP 5.4)
Ok. Let's define the class conditionally then:
// CommandAdapter.php
abstract class AbstractCommandAdapter extends Command
{
// current code except setCode()
}
if (method_exists('Symfony\Component\Console\Command\Command', 'asText')) {
// Symfony 3.0 compatible definition
class CommandAdapter extends AbstractCommandAdapter
{
public function setCode(callable $code) { ... }
}
} else {
// Symfony 2.0 compatible definition
class CommandAdapter extends AbstractCommandAdapter
{
public function setCode($code) { ... }
}
}
Done, all tests pass. Only Scrutinizer has something going on that seems having to do with their infrastructure. Does not seem like a problem here.
Perfect, thanks! :)
There seem to be a few problems with Travis/Style CI. Can you check?