Skip to content

CS: various array formatting fixes #1065

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

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/Core/Tokenizers/PHP/ArrayKeywordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static function dataArrayType()
'testMarker' => '/* testFunctionDeclarationParamDNFType */',
],
'closure param DNF type' => [
'testMarker' => '/* testClosureDeclarationParamDNFType */',
'testMarker' => '/* testClosureDeclarationParamDNFType */',
],
'arrow return DNF type' => [
'testMarker' => '/* testArrowDeclarationReturnDNFType */',
Expand Down
6 changes: 3 additions & 3 deletions tests/Core/Tokenizers/PHP/AttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static function dataAttribute()
'class attribute' => [
'testMarker' => '/* testAttribute */',
'tokenCodes' => [
T_STRING
T_STRING,
],
],
'class attribute with param' => [
Expand Down Expand Up @@ -105,7 +105,7 @@ public static function dataAttribute()
'function attribute' => [
'testMarker' => '/* testAttributeOnFunction */',
'tokenCodes' => [
T_STRING
T_STRING,
],
],
'function attribute with params' => [
Expand Down Expand Up @@ -389,7 +389,7 @@ public static function dataAttributeOnParameters()
'testMarker' => '/* testSingleAttributeOnParameter */',
'position' => 4,
'tokenCodes' => [
T_STRING
T_STRING,
],
],
'parameter attribute; multiple comma separated, inline' => [
Expand Down
20 changes: 10 additions & 10 deletions tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public static function dataSimple()
{
return [
'standard' => [
'testMarker' => '/* testStandard */',
'testMarker' => '/* testStandard */',
],
'mixed case' => [
'testMarker' => '/* testMixedCase */',
'testMarker' => '/* testMixedCase */',
],
];

Expand Down Expand Up @@ -423,28 +423,28 @@ public static function dataKeywordReturnTypes()
{
return [
'self' => [
'testMarker' => '/* testSelfReturnType */',
'testMarker' => '/* testSelfReturnType */',
],
'parent' => [
'testMarker' => '/* testParentReturnType */',
'testMarker' => '/* testParentReturnType */',
],
'callable' => [
'testMarker' => '/* testCallableReturnType */',
'testMarker' => '/* testCallableReturnType */',
],
'array' => [
'testMarker' => '/* testArrayReturnType */',
'testMarker' => '/* testArrayReturnType */',
],
'static' => [
'testMarker' => '/* testStaticReturnType */',
'testMarker' => '/* testStaticReturnType */',
],
'false' => [
'testMarker' => '/* testFalseReturnType */',
'testMarker' => '/* testFalseReturnType */',
],
'true' => [
'testMarker' => '/* testTrueReturnType */',
'testMarker' => '/* testTrueReturnType */',
],
'null' => [
'testMarker' => '/* testNullReturnType */',
'testMarker' => '/* testNullReturnType */',
],
];

Expand Down
94 changes: 47 additions & 47 deletions tests/Core/Tokenizers/PHP/DNFTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,150 +386,150 @@ public static function dataDNFTypeParentheses()
{
return [
'arrow function return type: in named parameter' => [
'testMarker' => '/* testDNFTypeArrowFnReturnInNamedParam */',
'testMarker' => '/* testDNFTypeArrowFnReturnInNamedParam */',
],
'closure return type: in named parameter' => [
'testMarker' => '/* testDNFTypeClosureReturnInNamedParam */',
'testMarker' => '/* testDNFTypeClosureReturnInNamedParam */',
],

'OO const type: unqualified classes' => [
'testMarker' => '/* testDNFTypeOOConstUnqualifiedClasses */',
'testMarker' => '/* testDNFTypeOOConstUnqualifiedClasses */',
],
'OO const type: modifiers in reverse order' => [
'testMarker' => '/* testDNFTypeOOConstReverseModifierOrder */',
'testMarker' => '/* testDNFTypeOOConstReverseModifierOrder */',
],
'OO const type: multi-dnf part 1' => [
'testMarker' => '/* testDNFTypeOOConstMulti1 */',
'testMarker' => '/* testDNFTypeOOConstMulti1 */',
],
'OO const type: multi-dnf part 2' => [
'testMarker' => '/* testDNFTypeOOConstMulti2 */',
'testMarker' => '/* testDNFTypeOOConstMulti2 */',
],
'OO const type: multi-dnf part 3' => [
'testMarker' => '/* testDNFTypeOOConstMulti3 */',
'testMarker' => '/* testDNFTypeOOConstMulti3 */',
],
'OO const type: namespace relative classes' => [
'testMarker' => '/* testDNFTypeOOConstNamespaceRelative */',
'testMarker' => '/* testDNFTypeOOConstNamespaceRelative */',
],
'OO const type: partially qualified classes' => [
'testMarker' => '/* testDNFTypeOOConstPartiallyQualified */',
'testMarker' => '/* testDNFTypeOOConstPartiallyQualified */',
],
'OO const type: fully qualified classes' => [
'testMarker' => '/* testDNFTypeOOConstFullyQualified */',
'testMarker' => '/* testDNFTypeOOConstFullyQualified */',
],

'OO property type: unqualified classes' => [
'testMarker' => '/* testDNFTypePropertyUnqualifiedClasses */',
'testMarker' => '/* testDNFTypePropertyUnqualifiedClasses */',
],
'OO property type: modifiers in reverse order' => [
'testMarker' => '/* testDNFTypePropertyReverseModifierOrder */',
'testMarker' => '/* testDNFTypePropertyReverseModifierOrder */',
],
'OO property type: multi-dnf namespace relative classes' => [
'testMarker' => '/* testDNFTypePropertyMultiNamespaceRelative */',
'testMarker' => '/* testDNFTypePropertyMultiNamespaceRelative */',
],
'OO property type: multi-dnf partially qualified classes' => [
'testMarker' => '/* testDNFTypePropertyMultiPartiallyQualified */',
'testMarker' => '/* testDNFTypePropertyMultiPartiallyQualified */',
],
'OO property type: multi-dnf fully qualified classes' => [
'testMarker' => '/* testDNFTypePropertyMultiFullyQualified */',
'testMarker' => '/* testDNFTypePropertyMultiFullyQualified */',
],
'OO property type: multi-dnf with readonly keyword 1' => [
'testMarker' => '/* testDNFTypePropertyWithReadOnlyKeyword1 */',
'testMarker' => '/* testDNFTypePropertyWithReadOnlyKeyword1 */',
],
'OO property type: multi-dnf with readonly keyword 2' => [
'testMarker' => '/* testDNFTypePropertyWithReadOnlyKeyword2 */',
'testMarker' => '/* testDNFTypePropertyWithReadOnlyKeyword2 */',
],
'OO property type: with static and readonly keywords' => [
'testMarker' => '/* testDNFTypePropertyWithStaticAndReadOnlyKeywords */',
'testMarker' => '/* testDNFTypePropertyWithStaticAndReadOnlyKeywords */',
],
'OO property type: with only static keyword' => [
'testMarker' => '/* testDNFTypePropertyWithOnlyStaticKeyword */',
'testMarker' => '/* testDNFTypePropertyWithOnlyStaticKeyword */',
],
'OO property type: with only final keyword' => [
'testMarker' => '/* testDNFTypeWithPHP84FinalKeyword */',
'testMarker' => '/* testDNFTypeWithPHP84FinalKeyword */',
],
'OO property type: with final and static keyword' => [
'testMarker' => '/* testDNFTypeWithPHP84FinalKeywordAndStatic */',
'testMarker' => '/* testDNFTypeWithPHP84FinalKeywordAndStatic */',
],

'OO method param type: first param' => [
'testMarker' => '/* testDNFTypeParam1WithAttribute */',
'testMarker' => '/* testDNFTypeParam1WithAttribute */',
],
'OO method param type: second param, first DNF' => [
'testMarker' => '/* testDNFTypeParam2 */',
'testMarker' => '/* testDNFTypeParam2 */',
],
'OO method param type: second param, second DNF' => [
'testMarker' => '/* testDNFTypeParam3 */',
'testMarker' => '/* testDNFTypeParam3 */',
],
'OO method param type: namespace relative classes' => [
'testMarker' => '/* testDNFTypeParamNamespaceRelative */',
'testMarker' => '/* testDNFTypeParamNamespaceRelative */',
],
'OO method param type: partially qualified classes' => [
'testMarker' => '/* testDNFTypeParamPartiallyQualified */',
'testMarker' => '/* testDNFTypeParamPartiallyQualified */',
],
'OO method param type: fully qualified classes' => [
'testMarker' => '/* testDNFTypeParamFullyQualified */',
'testMarker' => '/* testDNFTypeParamFullyQualified */',
],
'Constructor property promotion with multi DNF 1' => [
'testMarker' => '/* testDNFTypeConstructorPropertyPromotion1 */',
'testMarker' => '/* testDNFTypeConstructorPropertyPromotion1 */',
],
'Constructor property promotion with multi DNF 2' => [
'testMarker' => '/* testDNFTypeConstructorPropertyPromotion2 */',
'testMarker' => '/* testDNFTypeConstructorPropertyPromotion2 */',
],
'OO method return type: multi DNF 1' => [
'testMarker' => '/* testDNFTypeReturnType1 */',
'testMarker' => '/* testDNFTypeReturnType1 */',
],
'OO method return type: multi DNF 2' => [
'testMarker' => '/* testDNFTypeReturnType2 */',
'testMarker' => '/* testDNFTypeReturnType2 */',
],
'OO abstract method return type: multi DNF 1' => [
'testMarker' => '/* testDNFTypeAbstractMethodReturnType1 */',
'testMarker' => '/* testDNFTypeAbstractMethodReturnType1 */',
],
'OO abstract method return type: multi DNF 2' => [
'testMarker' => '/* testDNFTypeAbstractMethodReturnType2 */',
'testMarker' => '/* testDNFTypeAbstractMethodReturnType2 */',
],
'OO method return type: namespace relative classes' => [
'testMarker' => '/* testDNFTypeReturnTypeNamespaceRelative */',
'testMarker' => '/* testDNFTypeReturnTypeNamespaceRelative */',
],
'OO method return type: partially qualified classes' => [
'testMarker' => '/* testDNFTypeReturnPartiallyQualified */',
'testMarker' => '/* testDNFTypeReturnPartiallyQualified */',
],
'OO method return type: fully qualified classes' => [
'testMarker' => '/* testDNFTypeReturnFullyQualified */',
'testMarker' => '/* testDNFTypeReturnFullyQualified */',
],
'function param type: with reference' => [
'testMarker' => '/* testDNFTypeWithReference */',
'testMarker' => '/* testDNFTypeWithReference */',
],
'function param type: with spread' => [
'testMarker' => '/* testDNFTypeWithSpreadOperator */',
'testMarker' => '/* testDNFTypeWithSpreadOperator */',
],
'closure param type: with illegal nullable' => [
'testMarker' => '/* testDNFTypeClosureParamIllegalNullable */',
'testMarker' => '/* testDNFTypeClosureParamIllegalNullable */',
],
'closure return type' => [
'testMarker' => '/* testDNFTypeClosureReturn */',
'testMarker' => '/* testDNFTypeClosureReturn */',
],
'closure with use return type' => [
'testMarker' => '/* testDNFTypeClosureWithUseReturn */',
'testMarker' => '/* testDNFTypeClosureWithUseReturn */',
],

'arrow function param type' => [
'testMarker' => '/* testDNFTypeArrowParam */',
'testMarker' => '/* testDNFTypeArrowParam */',
],
'arrow function return type' => [
'testMarker' => '/* testDNFTypeArrowReturnType */',
'testMarker' => '/* testDNFTypeArrowReturnType */',
],
'arrow function param type with return by ref' => [
'testMarker' => '/* testDNFTypeArrowParamWithReturnByRef */',
'testMarker' => '/* testDNFTypeArrowParamWithReturnByRef */',
],

'illegal syntax: unnecessary parentheses (no union)' => [
'testMarker' => '/* testDNFTypeParamIllegalUnnecessaryParens */',
'testMarker' => '/* testDNFTypeParamIllegalUnnecessaryParens */',
],
'illegal syntax: union within parentheses, intersect outside' => [
'testMarker' => '/* testDNFTypeParamIllegalIntersectUnionReversed */',
'testMarker' => '/* testDNFTypeParamIllegalIntersectUnionReversed */',
],
'illegal syntax: nested parentheses' => [
'testMarker' => '/* testDNFTypeParamIllegalNestedParens */',
'testMarker' => '/* testDNFTypeParamIllegalNestedParens */',
],
];

Expand Down
Loading