? ? Pending

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
22 Dec 2017

Summary of Changes

Enhances the classmap stub generator by:

  • Reading the aliases out of JLoader::getDeprecatedAliases() which makes deprecation versions available
  • If a deprecation version is available, a stub doc block stub is written with a @deprecated tag (improves IDE integration by flagging the class as deprecated
  • Adds the "final" keyword to class declarations for final classes (another IDE integration improvement, IDEs will warn if you extend a final class and right now the generator doesn't account for this keyword which could make someone think the alias is extensible when it shouldn't be)

Testing Instructions

Apply the patch, run php build/stubGenerator.php and review the generated stubs.php file. In combination with #19050 you should see entries similar to this now:

screen shot 2017-12-22 at 9 29 48 am

avatar mbabker mbabker - open - 22 Dec 2017
avatar mbabker mbabker - change - 22 Dec 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Dec 2017
Category Repository
avatar mbabker mbabker - change - 22 Dec 2017
Labels Added: ?
avatar joomdonation joomdonation - test_item - 22 Dec 2017 - Tested successfully
avatar joomdonation
joomdonation - comment - 22 Dec 2017

I have tested this item successfully on 8328f90

Was waiting for this, thanks


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19138.

avatar laoneo laoneo - test_item - 22 Dec 2017 - Tested successfully
avatar laoneo
laoneo - comment - 22 Dec 2017

I have tested this item successfully on 8328f90


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19138.

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Dec 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Dec 2017

Ready to Commit after two successful tests.

avatar mbabker mbabker - change - 23 Dec 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-12-23 15:55:43
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 23 Dec 2017
avatar mbabker mbabker - merge - 23 Dec 2017
avatar Kubik-Rubik
Kubik-Rubik - comment - 5 Jan 2018

@mbabker

Michael, short question: I always get a case mismatch when using the generated stub file. Class names are completely in lowercase letters:

image

But in your screenshot I see "JRegistry" written properly. What can be the reason? Thanks!

avatar mbabker
mbabker - comment - 5 Jan 2018

You need to be using staging at a point after #19050 was merged.

avatar Kubik-Rubik
Kubik-Rubik - comment - 5 Jan 2018

As a workaround, I load the classmap file and extract the correct class names via a small regex:

$class_map = file_get_contents(JPATH_ROOT.'/libraries/classmap.php');
preg_match_all('@\(\'(.*)\',@U', $class_map, $classes_old);

and then set the correct name before assigning it to the file variable:

foreach($classes_old[1] as $class_old)
{
	if($oldName == strtolower($class_old))
	{
		$oldName = $class_old;
		break;
	}
}

Result:

image

avatar Kubik-Rubik
Kubik-Rubik - comment - 5 Jan 2018

Ah, I've just seen your solution. Thank you, Michael!

Add a Comment

Login with GitHub to post a comment