From 4abac7fcdc42f483e2efa8a6fa0dd74a04678ab8 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sun, 3 Nov 2019 22:21:25 +0100 Subject: [PATCH] Remove private function --- .../BooleanOperatorPlacementSniff.php | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php b/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php index 95e62bc23b..7bac1f0b8f 100644 --- a/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php +++ b/src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php @@ -74,8 +74,13 @@ public function process(File $phpcsFile, $stackPtr) T_BOOLEAN_OR, ]; + if ($this->allowOnly === 'first' || $this->allowOnly === 'last') { + $position = $this->allowOnly; + } else { + $position = null; + } + $operator = $parenOpener; - $position = $this->getDefaultPosition(); $error = false; $operators = []; @@ -191,22 +196,4 @@ public function process(File $phpcsFile, $stackPtr) }//end process() - /** - * Default to null value if the option is not 'first' or 'last' - * - * @return string|null - */ - private function getDefaultPosition() - { - switch ($this->allowOnly) { - case 'first': - case 'last': - return $this->allowOnly; - default: - return null; - } - - }//end getDefaultPosition() - - }//end class