Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,3 @@ $map = array_map(strtolower(...), $map);

// Ignore PHP 8.1 first class callable declarations.
$map = array_map(strtolower( ... ), $map);

// Intentional parse error. This has to be the last test in the file.
function bar( ...
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,3 @@ $map = array_map(strtolower(...), $map);

// Ignore PHP 8.1 first class callable declarations.
$map = array_map(strtolower( ... ), $map);

// Intentional parse error. This has to be the last test in the file.
function bar( ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

// Intentional parse error. Testing that the sniff is *not* triggered in this case.
function bar( ...
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,29 @@ final class SpreadOperatorSpacingAfterUnitTest extends AbstractSniffUnitTest
* The key of the array should represent the line number and the value
* should represent the number of errors that should occur on that line.
*
* @param string $testFile The name of the file being tested.
*
* @return array<int, int>
*/
public function getErrorList()
public function getErrorList($testFile='')
{
return [
12 => 1,
13 => 1,
20 => 2,
40 => 1,
41 => 1,
46 => 2,
60 => 1,
61 => 1,
66 => 2,
];
switch ($testFile) {
case 'SpreadOperatorSpacingAfterUnitTest.1.inc':
return [
12 => 1,
13 => 1,
20 => 2,
40 => 1,
41 => 1,
46 => 2,
60 => 1,
61 => 1,
66 => 2,
];

default:
return [];
}//end switch

}//end getErrorList()

Expand Down