I am continuing the work to namespace the librafries/src folder and I have a few questions
$classname = 'Joomla\CMS\Date\Date';
stays as it is or changes to $classname = Date and add a use statement at the top of the file
\JLoader::import('joomla.filesystem.stream');
stays as it is or removed and add a use statement at the top of the file
Labels |
Added:
?
|
thanks
Wrong on both :P
$classname = Date::class
(that just allows easier future refactoring in IDE's)use
statement with the namespaced classes as it will work just fine with the composer autoloaderJLoader imports where special cases where we named classes in weird ways that didn't conform to Joomla's built in autoloader. So yes you can remove it and replace it with a use statement as it will work just fine with the composer autoloader
Isnt that where we can do
use joomla\cms\blah\blah as ginger
??
Category | ⇒ | Code style |
Status | New | ⇒ | Discussion |
you don't need the as even :)
thanks
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-27 11:55:37 |
Closed_By | ⇒ | brianteeman |
For me it works like this: