?
avatar brianteeman
brianteeman
29 Jun 2018

I am starting to complete the namespacing of the admin components in J4 but I am only a trained monkey

I can see some existing namespacing that looks like this

use Joomla\CMS\Help\Help as JHelp;

	$this->page = JHelp::createUrl(\JFactory::getApplication()->input->get('page', 'JHELP_START_HERE'));

Is that just "lazy" coding to avoid having to rename every instance in the file of JHelp

Is it not more correct to be changed to

use Joomla\CMS\Help\Help;

	$this->page = Help::createUrl(\JFactory::getApplication()->input->get('page', 'JHELP_START_HERE'));

@laoneo @wilsonge

avatar brianteeman brianteeman - open - 29 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jun 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Jun 2018
avatar Bakual
Bakual - comment - 29 Jun 2018

Yes, first one is "lazy", but it's valid as well.
In the second case, you would have to change JHelp in the code to Help. So JHelp::createUrl becomes Help::createUrl

avatar brianteeman brianteeman - change - 29 Jun 2018
The description was changed
avatar brianteeman brianteeman - edited - 29 Jun 2018
avatar brianteeman
brianteeman - comment - 29 Jun 2018

I know its valid but if I am going to do this I want to do it right - thats why I was checking ;)

(there was a typo in my code above that I just fixed)

Thanks

avatar brianteeman brianteeman - change - 29 Jun 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-06-29 08:14:28
Closed_By brianteeman
avatar brianteeman brianteeman - close - 29 Jun 2018
avatar wilsonge
wilsonge - comment - 29 Jun 2018

Yup as Thomas said - it was just lazy - I think I did this very early on to try and help with the merge conflicts (a slash to remove would have been easier) but when we went back and namespaced the libraries in 3.x it became totally useless.

Add a Comment

Login with GitHub to post a comment