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

Open
wants to merge 4 commits into
base: 5.2-dev
Choose a base branch
from

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-5.2-dev RTC This Pull Request is Ready To Commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants