Andrewsville/PHP-Token-Reflection — Issue #29: Allow to set file extensions list for processDirectory()
Author: josser
Created: 2011-12-16 16:59:32+00:00
State: open

Hi, first of all, big thanks for you hard work!

I have small suggestion / improvement:
It would be very nice to give the ability to customize which file types should be processed by processDirectory() method.
I'm tried to parse my /usr/share/php/Zend directory and got this error:

PHP Fatal error: Uncaught exception 'TokenReflection\Exception\Runtime' with message 'Class "Zend_Acl_Assert_Interface" is already defined; in file "/usr/share/php/Zend/Acl/Assert/.svn/text-base/Interface.php.svn-base".' in /Users/josser/Projects/PHP-Token-Reflection/TokenReflection/ReflectionNamespace.php:416
Stack trace:
#0 /Users/josser/Projects/PHP-Token-Reflection/TokenReflection/Broker/Backend/Memory.php(423): TokenReflection\ReflectionNamespace->addFileNamespace(Object(TokenReflection\ReflectionFileNamespace))
#1 /Users/josser/Projects/PHP-Token-Reflection/TokenReflection/Broker.php(207): TokenReflection\Broker\Backend\Memory->addFile(Object(TokenReflection\ReflectionFile))
#2 /Users/josser/Projects/PHP-Token-Reflection/TokenReflection/Broker.php(275): TokenReflection\Broker->processFile('/usr/share/php/...', false)
#3 /Users/josser/Projects/PHP-Token-Reflection/application/test.php(11): TokenReflection\Broker->processDirectory('/usr/share/php/...')
#4 /Users/josser/Projects/PHP-Token-Reflection/application/test.php(16 in /Users/josser/Projects/PHP-Token-Reflection/TokenReflection/Broker.php on line 281

As you can see tokenizer wants to parse svn files and this causes an error.
Maybe ".php" and ".phtml" can be hardcoded but allow to override.
Thanks!