phpdoc-md icon indicating copy to clipboard operation
phpdoc-md copied to clipboard

PHP Notice: Array to string conversion

Open tivie opened this issue 8 years ago • 1 comments

Using latest PHPDocumentor and Twig (in PHP 7), a notice is raised:

PHP Notice:  Array to string conversion in \vendor\twig\twig\lib\Twig\Loader\Filesystem.php on line 34

Callstack:

Call Stack:
    0.0002     363344   1. {main}() vendor\evert\phpdoc-md\bin\phpdocmd:0
    0.0140     951672   2. PHPDocMD\Generator->run() \vendor\evert\phpdoc-md\bin\phpdocmd:79
    0.0152     999248   3. Twig_Loader_Filesystem->__construct() \vendor\evert\phpdoc-md\src\Generator.php:76

Checking twig's source code the second parameter is $rootpath but Generator.php is passing a "options array".

Related to #16

tivie avatar Aug 19 '17 19:08 tivie

This can be fixed by removing the second parameter and moving it to Twig_Environment:

SOURCE

$loader = new Twig_Loader_Filesystem($this->templateDir);
$twig = new Twig_Environment($loader, [
    'cache' => false,
    'debug' => true,
]);

tivie avatar Aug 19 '17 19:08 tivie