88use PhpCsFixerCustomFixers ;
99
1010class Config extends Base {
11- public function __construct ($ name = 'default ' ) {
11+ public function __construct ($ name = 'default ' , bool $ allowRisky = true ) {
1212 parent ::__construct ($ name );
1313 $ this ->setIndent ("\t" );
1414 $ this ->registerCustomFixers (new PhpCsFixerCustomFixers \Fixers ());
15+ $ this ->setRiskyAllowed ($ allowRisky );
1516 }
1617
1718 public function getRules () : array {
18- return [
19+ $ rules = [
1920 '@PSR1 ' => true ,
2021 '@PSR2 ' => true ,
2122 'align_multiline_comment ' => true ,
@@ -41,7 +42,6 @@ public function getRules() : array {
4142 'indentation_type ' => true ,
4243 'line_ending ' => true ,
4344 'list_syntax ' => true ,
44- 'logical_operators ' => true ,
4545 'lowercase_cast ' => true ,
4646 'lowercase_keywords ' => true ,
4747 'method_argument_space ' => [
@@ -85,5 +85,11 @@ public function getRules() : array {
8585 'yoda_style ' => ['equal ' => false , 'identical ' => false , 'less_and_greater ' => false ],
8686 PhpCsFixerCustomFixers \Fixer \MultilinePromotedPropertiesFixer::name () => true ,
8787 ];
88+
89+ if ($ this ->getRiskyAllowed ()) {
90+ $ rules ['logical_operators ' ] = true ;
91+ }
92+
93+ return $ rules ;
8894 }
8995}
0 commit comments