Trismegiste / Mondrian

A static php code analysis tool using the Graph Theory
http://trismegiste.github.io/Mondrian/
397 stars 22 forks source link

Digraph::addEdge() must be an instance of Vertex, null given #37

Closed xtrasmal closed 9 years ago

xtrasmal commented 9 years ago

Hi there,

I'm getting the following error: PHP Catchable fatal error: Argument 2 passed to Trismegiste\Mondrian\Graph\Digraph::addEdge() must be an instance of Trismegiste\Mondrian\Graph\Vertex, null given, called in phar:///usr/local/bin/mondrian/src/Visitor/EdgeCollector.php on line 118 and defined in phar:///usr/local/bin/mondrian/src/Graph/Digraph.php on line 59

Any idea why this might happen?

Trismegiste commented 9 years ago

Hello,

it mays be a uncaught parsing error. Without the parsed code it's difficult to say.

Are PHPUnit tests ok ?

xtrasmal commented 9 years ago

[ Nerd-ass log ] -[ Sunday morning ] - [02:15 o'clock] In Symfony applications it's all fine, but in the Laravel applications that I get the error message. It might be fetched or total mentalpoo, but could the fact that Laravel uses an IoC container to resolve dependencies cause this problem? Symfony is using a DI container. Like, if mondrian makes assumptions on how dependencies are resolved, then it could expect something being reflected in a certain way. Then this came to mind: http://stackoverflow.com/questions/1501726/splobjectstorage-doesnt-work-with-string-what-to-do ...but het, these assumptions without assertions so what do I know.

I'm going to see if I can reproduce the error.

[ Nerd-ass log ] -[ Sunday morning ] - [02:55 o'clock] ... Ok I played with mondrian the last half an hour. Ran commands in both symfony and laravel projects and can't reproduce the issue. If only I was more thorough in my issue report :-1: meh downer. Went through about 6 of my latest Symfony and about the same about of Laravel apps. Just can't find it.

_TLDR: I can't replicate the issue I reported. _

Trismegiste commented 9 years ago

Ok, no problem :+1:

Anyways, thanks for your time and your dedication :beers: