Skip to content

Commit

Permalink
Require parentheses for new() calls (even for anon. classes)
Browse files Browse the repository at this point in the history
  • Loading branch information
alies-dev committed Aug 8, 2024
1 parent 5f52814 commit 1fa886d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .php-cs-fixer-rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
return [
// Basic PER Coding Style 2.0 ruleset plus our overrides for it, see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/ruleSets/PER-CS2.0.rst
'@PER-CS2.0' => true, // https://www.php-fig.org/per/coding-style/}
'new_with_parentheses' => ['anonymous_class' => false], // @todo remove after migration to PHP-CS-Fixer v4.0, see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8148
'new_with_parentheses' => ['anonymous_class' => true], // It will be changed in PHP-CS-Fixer v4.0 (but we want to enforce it), see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8148
// overrides for PER-CS2.0
'concat_space' => ['spacing' => 'none'], // make strings shorter "'hello' . $name . '!'" => "'hello'.$name.'!'"
'blank_line_after_opening_tag' => false, // it makes "<?php declare(strict_types=1);" multiline (and more verbose)
Expand Down

0 comments on commit 1fa886d

Please sign in to comment.