Skip to content

Commit ad0bfc2

Browse files
committed
2 parents 2bfc1d6 + f3833cc commit ad0bfc2

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function register()
6666

6767
$tokens[] = T_VARIABLE;
6868
$tokens[] = T_CLOSE_CURLY_BRACKET;
69+
$tokens[] = T_CLOSE_SQUARE_BRACKET;
6970
$tokens[] = T_CLOSE_PARENTHESIS;
7071

7172
return $tokens;

src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ $bar = new stdClass(
9090
4,
9191
5,
9292
6
93-
93+
9494
);
9595

9696
$bar = new stdClass(
@@ -199,7 +199,7 @@ function foo()
199199
myFunction(
200200
'string'.
201201
// comment
202-
// comment
202+
// comment
203203
'string'.
204204
/* comment
205205
* comment
@@ -522,3 +522,6 @@ return trim(preg_replace_callback(
522522
},
523523
$search
524524
));
525+
526+
$a = ['a' => function ($b) { return $b; }];
527+
$a['a']( 1 );

src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function foo()
204204
myFunction(
205205
'string'.
206206
// comment
207-
// comment
207+
// comment
208208
'string'.
209209
/* comment
210210
* comment
@@ -534,3 +534,6 @@ return trim(
534534
$search
535535
)
536536
);
537+
538+
$a = ['a' => function ($b) { return $b; }];
539+
$a['a'](1);

src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public function getErrorList($testFile='FunctionCallSignatureUnitTest.inc')
125125
514 => 1,
126126
523 => 1,
127127
524 => 3,
128+
527 => 2,
128129
];
129130

130131
}//end getErrorList()

0 commit comments

Comments
 (0)