Skip to content

Commit 5a852b3

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into less-class-naming-strpos
2 parents 1798cf4 + 5f4cb84 commit 5a852b3

File tree

13 files changed

+207
-77
lines changed

13 files changed

+207
-77
lines changed

.github/workflows/php.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
php-version:
16-
- "7.3"
1716
- "7.4"
1817
- "8.0"
1918
- "8.1"

Magento2/Rector/Tests/AddArrayAccessInterfaceReturnTypes/AddArrayAccessInterfaceReturnTypesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class AddArrayAccessInterfaceReturnTypesTest extends AbstractRectorTestCase
1616
/**
1717
* @dataProvider provideData()
1818
*/
19-
public function test(SmartFileInfo $fileInfo): void
19+
public function test(string $fileInfo): void
2020
{
21-
$this->doTestFileInfo($fileInfo);
21+
$this->doTestFile($fileInfo);
2222
}
2323

2424
/**

Magento2/Rector/Tests/ReplaceMbStrposNullLimit/ReplaceMbStrposNullLimitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class ReplaceMbStrposNullLimitTest extends AbstractRectorTestCase
1616
/**
1717
* @dataProvider provideData()
1818
*/
19-
public function test(SmartFileInfo $fileInfo): void
19+
public function test(string $fileInfo): void
2020
{
21-
$this->doTestFileInfo($fileInfo);
21+
$this->doTestFile($fileInfo);
2222
}
2323

2424
/**

Magento2/Rector/Tests/ReplaceNewDateTimeNull/ReplaceNewDateTimeNullTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class ReplaceNewDateTimeNullTest extends AbstractRectorTestCase
1616
/**
1717
* @dataProvider provideData()
1818
*/
19-
public function test(SmartFileInfo $fileInfo): void
19+
public function test(string $fileInfo): void
2020
{
21-
$this->doTestFileInfo($fileInfo);
21+
$this->doTestFile($fileInfo);
2222
}
2323

2424
/**

Magento2/Rector/Tests/ReplacePregSplitNullLimit/ReplacePregSplitNullLimitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class ReplacePregSplitNullLimitTest extends AbstractRectorTestCase
1616
/**
1717
* @dataProvider provideData()
1818
*/
19-
public function test(SmartFileInfo $fileInfo): void
19+
public function test(string $fileInfo): void
2020
{
21-
$this->doTestFileInfo($fileInfo);
21+
$this->doTestFile($fileInfo);
2222
}
2323

2424
/**

Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ class ClassPropertyPHPDocFormattingSniff extends AbstractVariableSniff
2929
T_NS_SEPARATOR,
3030
T_STRING,
3131
T_COMMENT,
32-
T_NULLABLE
32+
T_NULLABLE,
33+
T_BITWISE_AND,
34+
T_TYPE_UNION,
3335
];
3436

3537
/**

Magento2/Sniffs/Legacy/TableNameSniff.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,10 @@ private function checkOccurrencesInProperty(File $phpcsFile, int $stackPtr, arra
189189
private function checkOccurrencesInArray(File $phpcsFile, int $stackPtr, array $tokens): void
190190
{
191191
$aliasPos = $phpcsFile->findPrevious(
192-
T_CONSTANT_ENCAPSED_STRING,
193-
$stackPtr -1
192+
T_WHITESPACE,
193+
$stackPtr - 1,
194+
null,
195+
true,
194196
);
195197

196198
$alias = trim($tokens[$aliasPos]['content'], '\'"');

Magento2/Sniffs/Less/ClassNamingSniff.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public function process(File $phpcsFile, $stackPtr)
6767
);
6868
}
6969

70-
if (strlen($className) > 1 && strpos($className, self::STRING_HELPER_CLASSES_PREFIX, 2) !== false) {
70+
if (strlen($className) > 1 && strpos($className, self::STRING_HELPER_CLASSES_PREFIX, 2) !== false
71+
&& !str_starts_with($className, 'admin__')
72+
) {
7173
$phpcsFile->addError(
7274
'CSS class names should be separated with "-" (dash) instead of "_" (underscore)',
7375
$stackPtr,

Magento2/Tests/Legacy/TableNameUnitTest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ $select = $connection->select()->from(
2828
['main_table' => 'magento_sample_table']
2929
);
3030

31+
$fooBar=array(0=>array(125,0,875,750),'33' =>array(85,0,194,716), 10 => 100);
32+
3133
class Collection extends \Magento\Sales\Model\ResourceModel\Report\Order\Collection
3234
{
3335
/**

Magento2/Tests/Legacy/TableNameUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function getErrorList($testFile = '')
1919
7 => 1,
2020
16 => 1,
2121
20 => 1,
22-
38 => 1,
22+
40 => 1,
2323
];
2424
}
2525

0 commit comments

Comments
 (0)