Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] phpcs comments / use statements #44194

Merged
merged 5 commits into from
Oct 20, 2024
Merged

Conversation

heelc29
Copy link
Contributor

@heelc29 heelc29 commented Oct 6, 2024

Summary of Changes

  • move use statements out of phpcs disable area
  • fix phpcs:enable identifier

Testing Instructions

code review

@Quy
Copy link
Contributor

Quy commented Oct 6, 2024

I have tested this item ✅ successfully on 0c6ea05


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

1 similar comment
@richard67
Copy link
Member

I have tested this item ✅ successfully on 0c6ea05


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

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 6, 2024
@brianteeman
Copy link
Contributor

are we sure we even need to disable phpcs for this? There are a lot of instances where it is not disabled

eg

* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;

@richard67
Copy link
Member

richard67 commented Oct 6, 2024

are we sure we even need to disable phpcs for this? There are a lot of instances where it is not disabled

@brianteeman It is needed when in that file a function is defined or a class. PHPCS say then that you shall not have both in the same file, a statement with side effects like the defined, and definition of a symbol.

In your example it is not needed because the function definitions are wrapped into an anonymous class.

@brianteeman
Copy link
Contributor

@richard67 Thanks you for the explanation

@pe7er pe7er self-assigned this Oct 18, 2024
@pe7er pe7er added this to the Joomla! 5.2.1 milestone Oct 20, 2024
@pe7er pe7er merged commit 3804cb3 into joomla:5.2-dev Oct 20, 2024
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 20, 2024
@pe7er
Copy link
Contributor

pe7er commented Oct 20, 2024

Thanks @heelc29 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants