File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -240,12 +240,10 @@ private function getParser(): Parser
240
240
241
241
private function getDirectoryIterator (string $ directory ): iterable
242
242
{
243
- $ default = function ($ directory ) {
244
- return new \RecursiveIteratorIterator (
245
- new \RecursiveDirectoryIterator ($ directory , \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS ),
246
- \RecursiveIteratorIterator::LEAVES_ONLY
247
- );
248
- };
243
+ $ default = fn ($ directory ) => new \RecursiveIteratorIterator (
244
+ new \RecursiveDirectoryIterator ($ directory , \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS ),
245
+ \RecursiveIteratorIterator::LEAVES_ONLY
246
+ );
249
247
250
248
if (null !== $ this ->directoryIteratorProvider ) {
251
249
return ($ this ->directoryIteratorProvider )($ directory , $ default );
@@ -256,9 +254,7 @@ private function getDirectoryIterator(string $directory): iterable
256
254
257
255
private function isReadable (string $ fileOrDirectory ): bool
258
256
{
259
- $ default = function ($ fileOrDirectory ) {
260
- return is_readable ($ fileOrDirectory );
261
- };
257
+ $ default = is_readable (...);
262
258
263
259
if (null !== $ this ->isReadableProvider ) {
264
260
return ($ this ->isReadableProvider )($ fileOrDirectory , $ default );
Original file line number Diff line number Diff line change @@ -45,9 +45,7 @@ public function unescapeSingleQuotedString(string $value): string
45
45
*/
46
46
public function unescapeDoubleQuotedString (string $ value ): string
47
47
{
48
- $ callback = function ($ match ) {
49
- return $ this ->unescapeCharacter ($ match [0 ]);
50
- };
48
+ $ callback = fn ($ match ) => $ this ->unescapeCharacter ($ match [0 ]);
51
49
52
50
// evaluate the string
53
51
return preg_replace_callback ('/ ' .self ::REGEX_ESCAPED_CHARACTER .'/u ' , $ callback , $ value );
You can’t perform that action at this time.
0 commit comments