laravel - PHP use namespace - A solution to including all classes under a namespace -


is there solution having include classes individually under namespace?

my laravel files getting huge because have keep including heck load of namespaces... it's pretty awful!

as temporary solution, why might following not working:

namespace.blah.txt:

use blah\blah;  use blah\bloh; 

php code:

eval( file_get_contents( "namespace.blah.txt" ); 

if work, evaluate contents of file... understand it's bit noob... but... dammit!

there isn't, in php 7 you'll able to

use foolibrary\bar\baz\{ classa, classb, classc, classd fizbo }; 

as following rfc has passed:

https://wiki.php.net/rfc/group_use_declarations

edit:

note many uses in class may sign of "smell". isn't particular class doing much? shouldn't creating new "base" classes , extending them?


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -