phpDocumentor.phar v2.8.5 & PHP 7.0.9 (cli) - Monolog\ErrorHandler::handleException() must be an instance of Exception, instance of Error given

Created on 17 Oct 2016  路  13Comments  路  Source: phpDocumentor/phpDocumentor

I am using phpDocumentor.phar on WN10.

When I run php phpDocumentor.phar -t ./docs -d ./src
I get fallowing error:

Notice: Array to string conversion in phar://C:/.../phpDocumentor.phar/vendor/erusev/parsedown/Parsedown.php on line 1405

Notice: Undefined property: Parsedown::$Array in phar://C:/.../phpDocumentor.phar/vendor/erusev/parsedown/Parsedown.php on line 1405

Fatal error: Uncaught TypeError: Argument 1 passed to Monolog\ErrorHandler::handleException() must be an instance of Exception, instance of Error given in phar://C:/.../phpDocumentor.phar/vendor/monolog/monolog/src/Monolog/ErrorHandler.php:122
Stack trace:
#0 [internal function]: Monolog\ErrorHandler->handleException(Object(Error))
#1 {main}
  thrown in phar://C:/.../phpDocumentor.phar/vendor/monolog/monolog/src/Monolog/ErrorHandler.php on line 122

PHP 7.0.9 (cli) (built: Jul 20 2016 11:08:23) ( ZTS )
(Ps .phar file works fine with PHP5)

Most helpful comment

Pear package still throws this error. Going to try .phar instead

All 13 comments

please upgrade your phar file. That should fix this error

Yes you are right 2.9.0 works. Thanks. They should update "www.phpdoc.org" so it links to 2.9.0 instead of 2.8.5.

@DevWL , how do you get the 2.9.0 version?

He downloaded the phar from this repo

If your're looking for 2.9.0 to solve PHP 7 issues then the .phar is at https://github.com/phpDocumentor/phpDocumentor2/releases/download/v2.9.0/phpDocumentor.phar

I'm getting the same thing.
Linux Mint 18.1
phpdoc 2.9.0 (installed via PEAR)
PHP Version 7.0.15-0ubuntu0.16.04.4

Applying 17 transformations
  Initialize writer "phpDocumentor\Plugin\Core\Transformer\Writer\FileIo"
  Initialize writer "phpDocumentor\Plugin\Twig\Writer\Twig"
  Initialize writer "phpDocumentor\Plugin\Graphs\Writer\Graph"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
[2017-07-18 14:27:51] phpDocumentor.ALERT: Fatal Error (E_ERROR): Uncaught TypeError: Argument 1 passed to Monolog\ErrorHandler::handleException() must be an instance of Exception, instance of Error given in /usr/share/php/phpDocumentor/vendor/monolog/monolog/src/Monolog/ErrorHandler.php:122 Stack trace: #0 [internal function]: Monolog\ErrorHandler->handleException(Object(Error)) #1 {main}   thrown {"file":"/usr/share/php/phpDocumentor/vendor/monolog/monolog/src/Monolog/ErrorHandler.php","line":122} []

Huh. ran from the .phar, and it seemed to work, at least on a small subset of my project.

I can confirm the same behavior on Ubuntu 16.04.

PHP 7.0.18-0ubuntu0.16.04.1
phpdoc 2.9.0

When using phar, it runs correctly, pear package shows the error reported above.

Oh, good, I thought I messed something up. I'm getting these same errors.

PHP 7.0.18-0ubuntu0.17.04.1
phpDocumentor-2.9.0

installed about 15 minutes ago via pear

Just used the .phar and it works fine

Pear package still throws this error. Going to try .phar instead

Pear package still hasn't been fixed, it seems.

Yeah, there's no way to get this working with my project. It has the exact same error from almost 2 years ago.

PHP 7.1.15-1+ubuntu16.04.1+deb.sury.org+2
phpDocumentor version 2.9.0

Does work from the latest tarball, though. Shame that the project seems to be abandoned to such a state that the Pear package isn't being fixed for php7.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adjenks picture adjenks  路  5Comments

mvriel picture mvriel  路  5Comments

PhrozenByte picture PhrozenByte  路  5Comments

olvlvl picture olvlvl  路  6Comments

jrfnl picture jrfnl  路  5Comments