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

PHP: PSR-1 asks for constants to be all upper case #138

Open
1 task done
rr-it opened this issue Jul 6, 2024 · 0 comments
Open
1 task done

PHP: PSR-1 asks for constants to be all upper case #138

rr-it opened this issue Jul 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@rr-it
Copy link

rr-it commented Jul 6, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe

This should not be valid PHP code as the class constant Permissions is not upper case.

final class TablePermissionElement extends AbstractFormElement
{
    private const Permissions = [];
}

Describe the solution you'd like

Maybe a PHP CS Fixer rule can be implemented to fix it to:

final class TablePermissionElement extends AbstractFormElement
{
    private const PERMISSIONS = [];
}

E.g. symplify/phpstan-rules: Rules/UppercaseConstantRule

Describe alternatives you've considered

No response

Additional context

There are no hard rules but TYPO3 follows coding standards.

PSR-1: Basic Coding Standard

TYPO3 coding standards

https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/CodingGuidelines/CglPhp/GeneralRequirementsForPhpFiles.html#typo3-coding-standards

The package TYPO3 Coding Standards provides the most up-to-date recommendation for using and enforcing common coding guidelines, which are continuously improved. The package also offers toolchain configuration for automatically adjusting code to these standards. Specifically, a PHP CS Fixer configuration is provided, that is based on PER-CS1.0 (PSR-12) at the time of this writing, and transitioning towards PER-CS2.0.

PSR-12: Extended Coding Style & PER Coding Style 2.0

https://www.php-fig.org/psr/psr-12/#21-basic-coding-standard
https://www.php-fig.org/per/coding-style/#2-general

2.1 Basic Coding Standard

Code MUST follow all rules outlined in PSR-1.

@rr-it rr-it added the enhancement New feature or request label Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants