zendframework / namespacer Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ralphschindler/namespacer
PHP Class converter to namepaces.
This project forked from ralphschindler/namespacer
PHP Class converter to namepaces.
Somehow the Zend dependencies does not seem to be correct, that's why the PHP file throws this fatal error after doing composer install and calling
php -f namespacer.php
This can e.g. be solved by replacing all Zend Framework packages by
"zendframework/zendframework": "2.3.*"
in the composer.json file.
how to transfer it from ZF2-php5.3 to ZF2-php7.2 ?
I keep getting errors about stdlib being locked to 3.1.0 whereas the package requires ^2.3.0.
Is it possible to use newer stdlib to prevent conflicts?
My project had a zero-byte .php file in it for some reason, and as soon as "namespacer map" encountered the file, it threw an exception:
======================================================================
The application has thrown an exception!
======================================================================
Zend\Code\Exception\RuntimeException
No tokens were provided
----------------------------------------------------------------------
phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-code/Zend/Code/Scanner/TokenArrayScanner.php:2
#0 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-code/Zend/Code/Scanner/TokenArrayScanner.php(2): Zend\Code\Scanner\TokenArrayScanner->scan()
#1 phar:///Users/brkendig/Downloads/namespacer.phar/src/Namespacer/Model/Mapper.php(2): Zend\Code\Scanner\TokenArrayScanner->getClassNames()
#2 phar:///Users/brkendig/Downloads/namespacer.phar/src/Namespacer/Model/Mapper.php(2): Namespacer\Model\Mapper->getMapDataForFile('/p4-wdpro/Proje...')
#3 phar:///Users/brkendig/Downloads/namespacer.phar/src/Namespacer/Controller/Controller.php(2): Namespacer\Model\Mapper->getMapDataForDirectory('src/library/PEP...')
#4 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-mvc/Zend/Mvc/Controller/AbstractActionController.php(2): Namespacer\Controller\Controller->createMapAction()
#5 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#6 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(2): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#7 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(2): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#8 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-mvc/Zend/Mvc/Controller/AbstractController.php(2): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#9 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-mvc/Zend/Mvc/DispatchListener.php(2): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Console\Request), Object(Zend\Console\Response))
#10 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(2): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#12 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php(2): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 phar:///Users/brkendig/Downloads/namespacer.phar/vendor/zendframework/zend-mvc/Zend/Mvc/Application.php(2): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 phar:///Users/brkendig/Downloads/namespacer.phar/namespacer.php(2): Zend\Mvc\Application->run()
#15 /Users/brkendig/Downloads/namespacer.phar(7): require('phar:///Users/b...')
#16 {main}
======================================================================
Previous Exception(s):
======================================================================
I worked around it by deleting the zero-byte file, but first it took quite a bit of divide-and-conquer to figure out what the problem was.
When I simply try to use the tool as you describe like this :
./namespacer.phar map --mapfile types.php --source ./site/
I get this result :
PHP Fatal error: Constructor Zend\Stdlib\Glob::glob() cannot be static in phar:///var/www/femme2-zf2/namespacer/namespacer.phar/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php on line 2
Fatal error: Constructor Zend\Stdlib\Glob::glob() cannot be static in phar:///var/www/femme2-zf2/namespacer/namespacer.phar/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php on line 2
Thanks for your reply
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.