Skip to content

Commit 4abac7f

Browse files
Remove private function
1 parent 5075df8 commit 4abac7f

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ public function process(File $phpcsFile, $stackPtr)
7474
T_BOOLEAN_OR,
7575
];
7676

77+
if ($this->allowOnly === 'first' || $this->allowOnly === 'last') {
78+
$position = $this->allowOnly;
79+
} else {
80+
$position = null;
81+
}
82+
7783
$operator = $parenOpener;
78-
$position = $this->getDefaultPosition();
7984
$error = false;
8085
$operators = [];
8186

@@ -191,22 +196,4 @@ public function process(File $phpcsFile, $stackPtr)
191196
}//end process()
192197

193198

194-
/**
195-
* Default to null value if the option is not 'first' or 'last'
196-
*
197-
* @return string|null
198-
*/
199-
private function getDefaultPosition()
200-
{
201-
switch ($this->allowOnly) {
202-
case 'first':
203-
case 'last':
204-
return $this->allowOnly;
205-
default:
206-
return null;
207-
}
208-
209-
}//end getDefaultPosition()
210-
211-
212199
}//end class

0 commit comments

Comments
 (0)