Skip to content

Commit

Permalink
Add some more arrow function tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig committed Mar 31, 2023
1 parent 9c1cb59 commit ae6637f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Tests/VariableAnalysisSniff/fixtures/ArrowFunctionFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,17 @@ public function __construct($key) {
};
echo $arrow;
}

function arrowFunctionWithQuotes($allowedReferrers) {
array_map(
static fn (string $allowedReferrer) => str_replace(
['\*\*', '\*'],
['[a-z\d.-]{0,63}', '[a-z\d-]{0,63}'],
preg_quote($allowedReferrer, '~'),
),
$allowedReferrers;
do_something(
static fn (string $permissionName) => Str::startsWith($permissionName, CONFIG_START)
&& $permissionName !== CustomPermission::ALL_CONFIG
);
}

0 comments on commit ae6637f

Please sign in to comment.