phpdoc-md
phpdoc-md copied to clipboard
PHP Notice: Array to string conversion
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
This can be fixed by removing the second parameter and moving it to Twig_Environment:
$loader = new Twig_Loader_Filesystem($this->templateDir);
$twig = new Twig_Environment($loader, [
'cache' => false,
'debug' => true,
]);