Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
use PhpCsFixerCustomFixers;

class Config extends Base {
public function __construct($name = 'default') {
public function __construct($name = 'default', bool $allowRisky = true) {
parent::__construct($name);
$this->setIndent("\t");
$this->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers());
$this->setRiskyAllowed($allowRisky);
}

public function getRules() : array {
return [
$rules = [
'@PSR1' => true,
'@PSR2' => true,
'align_multiline_comment' => true,
Expand All @@ -41,7 +42,6 @@ public function getRules() : array {
'indentation_type' => true,
'line_ending' => true,
'list_syntax' => true,
'logical_operators' => true,
'lowercase_cast' => true,
'lowercase_keywords' => true,
'method_argument_space' => [
Expand Down Expand Up @@ -85,5 +85,11 @@ public function getRules() : array {
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
PhpCsFixerCustomFixers\Fixer\MultilinePromotedPropertiesFixer::name() => true,
];

if ($this->getRiskyAllowed()) {
$rules['logical_operators'] = true;
}

return $rules;
}
}