clemens-tolboom / uml-generator-php

http://clemens-tolboom.github.io/uml-generator-php/
MIT License
44 stars 5 forks source link

Use reflection as a fallback. #62

Open clemens-tolboom opened 9 years ago

clemens-tolboom commented 9 years ago

When running json2dot we get a lot of "Not found" of which most are solvable when failling back on reflection I guess.

uml-generator-php$ bin/uml-generator-php run | grep "Not found" | sort -u
Not found: \ArrayAccess
Not found: \ArrayIterator
Not found: \Countable
Not found: \ExampleNameSpace\Examples
Not found: \ExampleNameSpace\OtherTrait
Not found: \ExampleNameSpace\SimpleExampleClass
Not found: \ExampleNameSpace\Things
Not found: \Exception
Not found: \FilterIterator
Not found: \Iterator
Not found: \IteratorAggregate
Not found: \PHP_CodeSniffer_Sniff
Not found: \PHP_CodeSniffer_Standards_AbstractPatternSniff
Not found: \PhpParser\Builder\PhpParser\BuilderAbstract
Not found: \PhpParser\Node\Stmt\Node\Stmt
Not found: \PhpParser\Node\Stmt\TraitUseAdaptation\Node\Stmt\TraitUseAdaptation
Not found: \Psr\Log\AbstractLogger
Not found: \Psr\Log\Test\LoggerInterfaceTest
Not found: \RecursiveDirectoryIterator
Not found: \RecursiveIterator
Not found: \RuntimeException
Not found: \SeekableIterator
Not found: \SplFileInfo
Not found: \Symfony\Component\EventDispatcher\Event
Not found: \UnexpectedValueException
MartijnBraam commented 9 years ago

Maybe we need to implement it the way PhpStorm does it. It has spl.php which is an empty implementation for build-in php classes.

clemens-tolboom commented 9 years ago

The spl.php contains multiple classes ... where to put those json files?

I think we should reuse our reflection based code which generated the missing files based on the runtime php version to generate a set of jsons.

Maybe we can prepackage but that would introduce bugs for our users as their binary PHP version may differ.

clemens-tolboom commented 9 years ago

I found a file online http://www.opensource.apple.com/source/apache_mod_php/apache_mod_php-44/php/ext/spl/spl.php (not sure what to do with it :p)