Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Update to String package 1.3 #6600
One of the changes in PHP 7 is the platform now allows Scalar Type Hints. Implementing this change means there are now some new reserved keywords in the language that cannot be used for class names, such as "string". We have a class named just that in the Framework's String package and have managed its deprecation at that level.
This PR updates the CMS to use the latest String package which includes a new "StringHelper" class to replace the existing "String" class. JString is modified to extend this directly versus the older class.
JString is used to help create aliases on items when you save them. So you should be able to create a new item and validate the alias is still processed correctly.
As JString, String, and StringHelper are all abstract, there is no practical reason to typehint against this class. However, in the very off chance someone may be, a JString object will no longer match a typehint for a String class. The typehint can be updated for StringHelper and everything will work out OK. I realize this is a fat chance, but it is a B/C break and the options are either this or Joomla 3 will not function on PHP 7.
Also added the application package to this because it had a reference to String that was replaced. And dropped unit tests fully for the registry and string packages (something about the string tests was causing the bad class to trigger in PHP 7 and the CMS shouldn't need to run a now partial test suite on code it is consuming).
@test I can confirm the patch. Before the patch: PHP 7 blew up telling me that string is a reserved class name. After the patch: I get the installer page. It won't go anywhere after that (loops back to the same page), but it's a good start!
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6600.