Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknow Error, Please help for this #356

Closed
anushkanz opened this issue Mar 19, 2019 · 7 comments
Closed

Unknow Error, Please help for this #356

anushkanz opened this issue Mar 19, 2019 · 7 comments
Assignees
Labels

Comments

@anushkanz
Copy link

phpDox 0.12.0-dev - Copyright (C) 2010 - 2019 by Arne Blankerts and Contributors

[19.03.2019 - 21:32:11] Using config file './phpdox.xml'
[19.03.2019 - 21:32:11] Registered collector backend 'parser'
[19.03.2019 - 21:32:11] Registered enricher 'build'
[19.03.2019 - 21:32:11] Registered enricher 'git'
[19.03.2019 - 21:32:11] Registered enricher 'checkstyle'
[19.03.2019 - 21:32:11] Registered enricher 'phpcs'
[19.03.2019 - 21:32:11] Registered enricher 'pmd'
[19.03.2019 - 21:32:11] Registered enricher 'phpunit'
[19.03.2019 - 21:32:11] Registered enricher 'phploc'
[19.03.2019 - 21:32:11] Registered output engine 'xml'
[19.03.2019 - 21:32:11] Registered output engine 'html'
[19.03.2019 - 21:32:11] Starting to process project 'phpdox'
[19.03.2019 - 21:32:11] Starting collector
[19.03.2019 - 21:32:11] Scanning directory '/Applications/XAMPP/xamppfiles/htdocs/twilio' for files to process

.................................................. [50]
.................................................. [100]
.................................................. [150]
.................................................. [200]
.................................................. [250]
.................................................. [300]
.......f.......................................... [350]
.................................................. [400]
.................................................. [450]
.................................................. [500]
.................................................. [550]
.................................................. [600]
.....................................f.f...ffff... [650]
f......

Oups... phpDox encountered a problem and has terminated!

It most likely means you've found a bug, so please file a report for this
and paste the following details and the stacktrace (if given) along:

PHP Version: 7.2.14 (Darwin)
PHPDox Version: 0.12.0-dev
Exception: TypeError (Code: 0)
Location: /Applications/XAMPP/xamppfiles/htdocs/twilio/vendor/theseer/phpdox/src/collector/project/SourceFile.php (Line 74)

Return value of TheSeer\phpDox\Collector\SourceFile::getSource() must be of the type string, null returned

#0 /Applications/XAMPP/xamppfiles/htdocs/twilio/vendor/theseer/phpdox/src/collector/Collector.php(101): TheSeer\phpDox\Collector\Backend\PHPParser->parse()
#1 /Applications/XAMPP/xamppfiles/htdocs/twilio/vendor/theseer/phpdox/src/collector/Collector.php(71): TheSeer\phpDox\Collector\Collector->processFile()
#2 /Applications/XAMPP/xamppfiles/htdocs/twilio/vendor/theseer/phpdox/src/Application.php(88): TheSeer\phpDox\Collector\Collector->run()
#3 /Applications/XAMPP/xamppfiles/htdocs/twilio/vendor/theseer/phpdox/src/CLI.php(120): TheSeer\phpDox\Application->runCollector()
#4 /Applications/XAMPP/xamppfiles/htdocs/twilio/vendor/theseer/phpdox/phpdox(68): TheSeer\phpDox\CLI->run()

@theseer
Copy link
Owner

theseer commented Mar 19, 2019

On first glance, the crash seems to be related to the fact that some files failed parsing - as in all files with 'f' in the dotted output - and phpDox under PHP 7's strict types does not handle this properly.

That qualifies as a clear bug.

@theseer theseer added the Bug label Mar 19, 2019
@theseer theseer self-assigned this Mar 19, 2019
@theseer
Copy link
Owner

theseer commented Mar 19, 2019

Looking at SourceFile::getSource() the only way this method can return null instead of a string is by having the included regex call fail - which PHP translates into not helpful null as a return value.

I changed the code to handle this situation - even though I have no idea on how to test for this as I cannot come up with a testcase that would trigger it.

I'll include this change into 0.12.1 and would like you to check what happens when run against your codebase. The issue is probably not fixed with this but the Regex Error Code - if any - might help debugging this further.

theseer added a commit that referenced this issue Mar 19, 2019
@theseer
Copy link
Owner

theseer commented Mar 19, 2019

If you do not want to wait for 0.12.1, feel free to run a test against master.

@anushkanz
Copy link
Author

Hey, I just compare my code and your master file, Both are same. But Still, have the same issue.
Looking forward to see proper solution.
Thanks

@theseer
Copy link
Owner

theseer commented Mar 19, 2019

The change is in ab50417. Again, this is not a fix per se but it catches the null and translates it into an exception.

@anushkanz
Copy link
Author

Oups... phpDox encountered a problem and has terminated!

It most likely means you've found a bug, so please file a report for this
and paste the following details and the stacktrace (if given) along:

PHP Version: 7.2.14 (Darwin)
PHPDox Version: 0.12.0-dev
ErrorException: E_ERROR
Location: /Applications/XAMPP/xamppfiles/htdocs/twilio/vendor/theseer/phpdox/src/collector/project/Tokenizer.php (Line 116)

Allowed memory size of 134217728 bytes exhausted (tried to allocate 3401200 bytes)

No stacktrace available

I can see its used all the memory I allocated. But there is another error I can see before that happen. If any chance you can help to fix that its really appreciated
Thanks

@anushkanz
Copy link
Author

Found this answer, I am working on Laravel project I accidentally add vendor folder so I remove that from scanning list.
Now it's working fine
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants