Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Command] Cache:clear is broken #7604

Closed
@XWB

Description

@XWB

We have a custom AppKernel:

use Symfony\Component\HttpKernel\Kernel;

class AppKernel extends Kernel
{
    protected $data;

    public function __construct($environment, $debug, array $data)
    {
        parent::__construct($environment, $debug);

        $this->data = $data;
    }
}

$kernel = new AppKernel('dev', true, [1, 2, 4]);

Running the cache:clear command throws the following exception:

Catchable Fatal Error: Argument 3 passed to AppKernel::__construct() must be of the type array, none given, called in CacheClearCommand.php on line 198 and defined in /path/AppKernel.php line 15

Now let's have a look in CacheClearCommand.php on line 198: https://github.com/symfony/symfony/blob/2.2/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php#L198

return new $class($parent->getEnvironment(), $parent->isDebug());

Adding a third parameter makes the command working again:

return new $class($parent->getEnvironment(), $parent->isDebug(), [1, 2, 4]);

I believe the command is broken since Symfony 2.2.1. How should this be fixed?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions