Skip to content

Conversation

simPod
Copy link
Contributor

@simPod simPod commented Mar 20, 2025

Probably caused by update in slevomat or squizlabs

I don't really want to dig what's new, all are legit finds:

vendor/bin/phpcs `find tests/input/PropertyDeclaration.php` WARNING: The PHPCS Coding Standards for doctrine/coding-standards standard uses 1 deprecated sniff ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - SlevomatCodingStandard.TypeHints.UnionTypeHintFormat This sniff has been deprecated since Slevomat Coding Standard 8.16.0 and will be removed in Slevomat Coding Standard 9.0.0. Use SlevomatCodingStandard.TypeHints.DNFTypeHintFormat instead. Deprecated sniffs are still run, but will stop working at some point in the future. E 1 / 1 (100%) FILE: tests/input/PropertyDeclaration.php -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 16 ERRORS AFFECTING 5 LINES -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9 | ERROR | [x] Equals sign not aligned correctly; expected 1 space but found 2 spaces (Generic.Formatting.MultipleStatementAlignment.Incorrect) 10 | ERROR | [x] There must be exactly one space between type hint and property $stringProperty. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenTypeHintAndProperty) 10 | ERROR | [x] There must be 1 space after the property type declaration; 2 found (PSR2.Classes.PropertyDeclaration.SpacingAfterType) 11 | ERROR | [x] Scope keyword "public" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 11 | ERROR | [x] There must be exactly one space before type hint of property $intProperty. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBeforeTypeHint) 12 | ERROR | [x] Usage of short nullable type hint in "?string" is disallowed. (SlevomatCodingStandard.TypeHints.UnionTypeHintFormat.DisallowedShortNullable) 12 | ERROR | [x] There must be no whitespace between type hint nullability symbol and type hint of property $nullableString. (SlevomatCodingStandard.Classes.PropertyDeclaration.WhitespaceAfterNullabilitySymbol) 15 | ERROR | [x] Expected 1 space after visibility modifier "public"; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterVisbility) 15 | ERROR | [x] Scope keyword "public" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 15 | ERROR | [x] There must be exactly one space between modifiers of property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenModifiers) 15 | ERROR | [x] Expected 1 space after readonly modifier; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterReadonly) 15 | ERROR | [x] Scope keyword "readonly" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 15 | ERROR | [x] There must be exactly one space before type hint of property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBeforeTypeHint) 15 | ERROR | [x] Expected 1 space between type hint and argument "$foo"; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint) 15 | ERROR | [x] There must be exactly one space between parameter type hint and parameter $foo. (SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing.MultipleSpacesBetweenTypeHintAndParameter) 15 | ERROR | [x] There must be exactly one space between type hint and property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenTypeHintAndProperty) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Time: 95ms; Memory: 12MB 
Probably caused by update in slevomat or squizlabs I don't really want to dig what's new, all are legit finds: ``` vendor/bin/phpcs `find tests/input/PropertyDeclaration.php` WARNING: The PHPCS Coding Standards for doctrine/coding-standards standard uses 1 deprecated sniff ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - SlevomatCodingStandard.TypeHints.UnionTypeHintFormat This sniff has been deprecated since Slevomat Coding Standard 8.16.0 and will be removed in Slevomat Coding Standard 9.0.0. Use SlevomatCodingStandard.TypeHints.DNFTypeHintFormat instead. Deprecated sniffs are still run, but will stop working at some point in the future. E 1 / 1 (100%) FILE: tests/input/PropertyDeclaration.php -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 16 ERRORS AFFECTING 5 LINES -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9 | ERROR | [x] Equals sign not aligned correctly; expected 1 space but found 2 spaces (Generic.Formatting.MultipleStatementAlignment.Incorrect) 10 | ERROR | [x] There must be exactly one space between type hint and property $stringProperty. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenTypeHintAndProperty) 10 | ERROR | [x] There must be 1 space after the property type declaration; 2 found (PSR2.Classes.PropertyDeclaration.SpacingAfterType) 11 | ERROR | [x] Scope keyword "public" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 11 | ERROR | [x] There must be exactly one space before type hint of property $intProperty. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBeforeTypeHint) 12 | ERROR | [x] Usage of short nullable type hint in "?string" is disallowed. (SlevomatCodingStandard.TypeHints.UnionTypeHintFormat.DisallowedShortNullable) 12 | ERROR | [x] There must be no whitespace between type hint nullability symbol and type hint of property $nullableString. (SlevomatCodingStandard.Classes.PropertyDeclaration.WhitespaceAfterNullabilitySymbol) 15 | ERROR | [x] Expected 1 space after visibility modifier "public"; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterVisbility) 15 | ERROR | [x] Scope keyword "public" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 15 | ERROR | [x] There must be exactly one space between modifiers of property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenModifiers) 15 | ERROR | [x] Expected 1 space after readonly modifier; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterReadonly) 15 | ERROR | [x] Scope keyword "readonly" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 15 | ERROR | [x] There must be exactly one space before type hint of property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBeforeTypeHint) 15 | ERROR | [x] Expected 1 space between type hint and argument "$foo"; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint) 15 | ERROR | [x] There must be exactly one space between parameter type hint and parameter $foo. (SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing.MultipleSpacesBetweenTypeHintAndParameter) 15 | ERROR | [x] There must be exactly one space between type hint and property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenTypeHintAndProperty) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Time: 95ms; Memory: 12MB ```
@simPod simPod force-pushed the fix-property-declaration branch from 674855e to 3710972 Compare March 20, 2025 22:42
@simPod
Copy link
Contributor Author

simPod commented Mar 20, 2025

Based on the diff the new ones IMO are:

 15 | ERROR | [x] Expected 1 space after visibility modifier "public"; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterVisbility) 15 | ERROR | [x] Expected 1 space after readonly modifier; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterReadonly) 
@greg0ire greg0ire merged commit 9ef5984 into doctrine:12.0.x Mar 21, 2025
14 checks passed
@greg0ire
Copy link
Member

Thanks @simPod !

@simPod simPod deleted the fix-property-declaration branch March 21, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants