Skip to content

Commit

Permalink
Laravel: Add yoda_style rule
Browse files Browse the repository at this point in the history
- bin\relax (yoda_style)
- laravel/pint@b6da337
  • Loading branch information
realodix committed Sep 5, 2023
1 parent 89360e6 commit fa09262
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/relax
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
}

if (null === $file) {
if ($file === null) {
throw new RuntimeException('Unable to locate autoload.php file.');
}

Expand Down
6 changes: 6 additions & 0 deletions src/RuleSet/Sets/Laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ protected function rules(): array
'unary_operator_spaces' => true,
'visibility_required' => ['elements' => ['method', 'property']],
'whitespace_after_comma_in_array' => true,
'yoda_style' => [
'always_move_variable' => true,
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],

// risky
'self_accessor' => false,
Expand Down

0 comments on commit fa09262

Please sign in to comment.