? Pending

User tests: Successful: Unsuccessful:

avatar C-Lodder
C-Lodder
12 Mar 2019

Pull Request for Issue #24108

Summary of Changes

I'm aware that there are still instances where the J prefixed class only resides in comment blocks and the use case is still added. My regex stills aren't top notch so I'll leave it up the the powers that be to decide whether or not they're fussed about this. If it's a problem I can close this and anyone willing to improve the regex can take over from me.

  • JText
  • JPath
  • JFile
  • JFolder
  • JStream
  • JFilesystemHelper
  • JObject
  • JImageFilter
  • JImage
  • JFeedPerson
  • JFeedParser
  • JFeedEntry
  • JFeed
  • JInputFiles
  • JInputCli

Testing Instructions

Browse through the frontend/backend and check for any errors

b2a8996 10 Mar 2019 avatar C-Lodder jtext
2fa1d7c 12 Mar 2019 avatar C-Lodder test
d6842db 12 Mar 2019 avatar C-Lodder jpath
d406d1f 12 Mar 2019 avatar C-Lodder feed
avatar C-Lodder C-Lodder - open - 12 Mar 2019
avatar C-Lodder C-Lodder - change - 12 Mar 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Mar 2019
Category Administration com_banners com_categories com_checkin com_config com_contact com_content com_contenthistory com_csp com_fields com_installer com_joomlaupdate com_languages
avatar C-Lodder C-Lodder - change - 12 Mar 2019
The description was changed
avatar C-Lodder C-Lodder - edited - 12 Mar 2019
avatar brianteeman
brianteeman - comment - 12 Mar 2019

cool stuff

avatar brianteeman
brianteeman - comment - 12 Mar 2019

When the change is only in the docblock does it still need to have the use namespace statement?

avatar C-Lodder
C-Lodder - comment - 12 Mar 2019

No. My regex initially dealt with comment blocks but then only detected classes with a leading backslash. Couldnt figure it out so just stuck with this

avatar C-Lodder C-Lodder - change - 13 Mar 2019
Labels Added: ?
avatar SharkyKZ
SharkyKZ - comment - 13 Mar 2019

There's still many issues left. Maybe it would be simpler to do this by directory or extension rather than by class.

de082da 13 Mar 2019 avatar C-Lodder fix
avatar C-Lodder
C-Lodder - comment - 13 Mar 2019

@SharkyKZ I've fixed the remaining errors I could find. Other than that, it just looks like CS

avatar SharkyKZ
SharkyKZ - comment - 14 Mar 2019

For classes that are only used as part of a docblock you could remove import statements and use fully qualified names instead. Not sure which is the preferred way. @joomla/maintainers?

For classes only used in inline comments use fully qualified names and no import statement.

avatar roland-d
roland-d - comment - 14 Mar 2019

For classes that are only used as part of a docblock you could remove import statements and use fully qualified names instead. Not sure which is the preferred way. @joomla/maintainers?

I wonder how that could happen? What is in your docblock is used in your function or not?

My idea is we use imports for everything but whatever the powers may decide :)

avatar SharkyKZ
SharkyKZ - comment - 14 Mar 2019

@roland-d This happens a lot. E.g. in classes when a function argument is an object but it's not typehinted. So you have it in the docblock but not in the code.

avatar C-Lodder
C-Lodder - comment - 15 Mar 2019

Ok it looks like the regex needs improving to make this automated. I'm going to close this for now and someone with more regex experience can take over.

@SharkyKZ Sorry for wasting your time, but I really appreciate the time you took to review it.

avatar C-Lodder C-Lodder - change - 15 Mar 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-03-15 10:28:29
Closed_By C-Lodder
avatar C-Lodder C-Lodder - close - 15 Mar 2019

Add a Comment

Login with GitHub to post a comment