Skip to content

ContainerLoader - implode(): Invalid arguments passed #119

Description

@f3l1x

PHP: 7.0
nette/di: 2.4.0


This snippet of code triggered error.

    $loader = new ContainerLoader(TEMP_DIR, TRUE);
    $class = $loader->load(function (Compiler $compiler) {
        $compiler->addExtension('a', new FoobarExtension);
    }, 'foobar');
   Exited with error code 255 (expected 0)
   E_WARNING: implode(): Invalid arguments passed

   in src/DI/ContainerLoader.php(119) 
   in src/DI/ContainerLoader.php(119) implode()
   in src/DI/ContainerLoader.php(82) Nette\DI\ContainerLoader->generate()
   in src/DI/ContainerLoader.php(47) Nette\DI\ContainerLoader->loadFile()

I think that problem might be here (double implode).

https://github.com/nette/di/blob/v2.4.0/src/DI/Compiler.php#L161
https://github.com/nette/di/blob/v2.4.0/src/DI/ContainerLoader.php#L119


Is it wrong usage or it is really bug? :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions