mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 12:29:43 +01:00
fix naming
This commit is contained in:
parent
ece2b6730d
commit
6c87ff6c1f
@ -83,17 +83,17 @@ final class UnnecessaryTernaryExpressionRector extends AbstractRector
|
||||
*/
|
||||
public function refactor(Node $ternaryNode): ?Node
|
||||
{
|
||||
/** @var BinaryOp $binaryOpOperation */
|
||||
$binaryOpOperation = $ternaryNode->cond;
|
||||
/** @var BinaryOp $binaryOperation */
|
||||
$binaryOperation = $ternaryNode->cond;
|
||||
|
||||
if ($this->ifValue === 'true' && $this->elseValue === 'false') {
|
||||
return $binaryOpOperation;
|
||||
return $binaryOperation;
|
||||
}
|
||||
|
||||
return $this->fixBinaryOperation($binaryOpOperation);
|
||||
return $this->inverseBinaryOperation($binaryOperation);
|
||||
}
|
||||
|
||||
private function fixBinaryOperation(BinaryOp $operation): BinaryOp
|
||||
private function inverseBinaryOperation(BinaryOp $operation): BinaryOp
|
||||
{
|
||||
$inverseOperandMap = [
|
||||
Identical::class => NotIdentical::class,
|
||||
|
Loading…
x
Reference in New Issue
Block a user