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

phpDox crash on execution #72

Closed
jskarpe opened this issue Jul 26, 2012 · 5 comments
Closed

phpDox crash on execution #72

jskarpe opened this issue Jul 26, 2012 · 5 comments

Comments

@jskarpe
Copy link

jskarpe commented Jul 26, 2012

 [exec] .......f.........f....................
 [exec] 
 [exec] Oups... phpDox encountered a problem and has terminated!
 [exec] It most likely means you've found a bug, so please file a report for this and paste the stacktrace (if given) along!
 [exec] 
 [exec] Exception: ReflectionException
 [exec] Location: /usr/share/php/pdepend/reflection/api/StaticReflectionProperty.php (Line 219)
 [exec] 
 [exec] Invalid property modifier given.
 [exec] 
 [exec] #0 /usr/share/php/pdepend/reflection/parser/Parser.php(1015): pdepend\reflection\api\StaticReflectionProperty->__construct()
 [exec] #1 /usr/share/php/pdepend/reflection/parser/Parser.php(980): pdepend\reflection\parser\Parser->_parsePropertyDeclaration()
 [exec] #2 /usr/share/php/pdepend/reflection/parser/Parser.php(795): pdepend\reflection\parser\Parser->_parsePropertyDeclarations()
 [exec] #3 /usr/share/php/pdepend/reflection/parser/Parser.php(450): pdepend\reflection\parser\Parser->_parseClassOrInterfaceScope()
 [exec] #4 /usr/share/php/pdepend/reflection/parser/Parser.php(255): pdepend\reflection\parser\Parser->_parseClassDeclaration()
 [exec] #5 /usr/share/php/pdepend/reflection/parser/Parser.php(192): pdepend\reflection\parser\Parser->_parse()
 [exec] #6 /usr/share/php/pdepend/reflection/parser/Parser.php(178): pdepend\reflection\parser\Parser->parseSource()
 [exec] #7 /usr/share/php/pdepend/reflection/queries/ReflectionQuery.php(114): pdepend\reflection\parser\Parser->parseFile()
 [exec] #8 /usr/share/php/pdepend/reflection/queries/ReflectionFileQuery.php(94): pdepend\reflection\queries\ReflectionQuery->parseFile()
 [exec] #9 /usr/share/php/TheSeer/phpDox/collector/Analyser.php(84): pdepend\reflection\queries\ReflectionFileQuery->find()
 [exec] #10 /usr/share/php/TheSeer/phpDox/collector/Collector.php(89): TheSeer\phpDox\Analyser->processFile()
 [exec] #11 /usr/share/php/TheSeer/phpDox/Application.php(123): TheSeer\phpDox\Collector->run()
 [exec] #12 /usr/share/php/TheSeer/phpDox/CLI.php(124): TheSeer\phpDox\Application->runCollector()
 [exec] #13 /usr/bin/phpdox(62): TheSeer\phpDox\CLI->run()
 [exec] 
 [exec] 
 [exec] 
 [exec] f
 [exec] Result: 1

I'm using phpDox 0.4.0 installed using PEAR

@theseer
Copy link
Owner

theseer commented Jul 26, 2012

That's a crash within the staticReflection. Can you provide me with a source tree that triggers this behavior? It looks like the code parsed is having a modified (private, protected, ...) for a property that is invalid. Usually that code shouldn't even pass a php lint check.

@jskarpe
Copy link
Author

jskarpe commented Jul 27, 2012

I have no idea what line of code it's crashing on. I'm attempting to switch from phpDocumentor to phpDox, and haven't had any issues with lint, phpDocumentor or phpunit in this project earlier.

@jskarpe
Copy link
Author

jskarpe commented Jul 27, 2012

The argument for setModifiers was int(258) - wouldn't this indicate abstract public function?

@justindemaris
Copy link

I fixed this by modifying pdepend/reflection/api/StaticReflectionProperty.php and adding a new const:

const IS_ABSTRACT = 2;

and modifying line 219 to include self::IS_ABSTRACT in the expected bitmask.

Hope that helps somebody else. \Reflection::getModifierNames agreed that 258 is the mask for abstract and public.

@theseer
Copy link
Owner

theseer commented Oct 14, 2012

Thank you for finding and fixing it. Forwarding this to Mapi.

@theseer theseer closed this as completed Oct 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants