Skip to content

Commit

Permalink
use data_get and position argument
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfox committed Nov 2, 2024
1 parent 29fc9c9 commit a1a41ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static function defaultLaravelMethods(): array
return [
new ApplyDefaultInsteadOfNullCoalesce('config'),
new ApplyDefaultInsteadOfNullCoalesce('env'),
new ApplyDefaultInsteadOfNullCoalesce('data_get', argumentPosition: 2),
new ApplyDefaultInsteadOfNullCoalesce('input', new ObjectType('Illuminate\Http\Request')),
new ApplyDefaultInsteadOfNullCoalesce('get', new ObjectType('Illuminate\Support\Env')),
];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace RectorLaravel\Tests\Rector\Coalesce\ApplyDefaultInsteadOfNullCoalesceRector\Fixture;

data_get([], 'key') ?? false;

?>
-----
<?php

namespace RectorLaravel\Tests\Rector\Coalesce\ApplyDefaultInsteadOfNullCoalesceRector\Fixture;

data_get([], 'key', false);

?>

0 comments on commit a1a41ce

Please sign in to comment.