[ 'fooFoo(); break; case "B": $a->barBar(); break; }', ], 'getClassConstArg' => [ 'fooFoo(); break; case B::class: $a->barBar(); break; }', ], 'getClassExteriorArgClassConsts' => [ 'getMessage(); break; case LogicException::class: $e->getMessage(); break; } } ', ], 'getClassExteriorArg' => [ 'getMessage(); break; case "LogicException": $e->getMessage(); break; } }', ], 'switchGetClassVar' => [ 'foo(); break; } }', ], 'getTypeArg' => [ ' [ 'a !== null: return $obj->a; // definitely not null case !is_null($obj->b): return $obj->b; // definitely not null default: throw new \InvalidArgumentException("$obj->a or $obj->b must be set"); } }', ], 'switchMoTruthy' => [ 'a: return $obj->a; // definitely not null case $obj->b: return $obj->b; // definitely not null default: throw new \InvalidArgumentException("$obj->a or $obj->b must be set"); } }', ], 'switchWithBadBreak' => [ ' [ ' [ ' [ '$x' => 'bool', '$y' => 'bool', ], ], ]; } /** * @return array */ public function providerFileCheckerInvalidCodeParse() { return [ 'switchReturnTypeWithFallthroughAndBreak' => [ ' 'InvalidReturnType', ], 'switchReturnTypeWithFallthroughAndConditionalBreak' => [ ' 'InvalidReturnType', ], 'switchReturnTypeWithNoDefault' => [ ' 'InvalidReturnType', ], 'getClassArgWrongClass' => [ 'barBar(); break; }', 'error_message' => 'UndefinedMethod', ], 'getClassMissingClass' => [ ' 'UndefinedClass', ], 'getTypeNotAType' => [ ' 'UnevaluatedCode', ], 'getTypeArgWrongArgs' => [ ' 'InvalidScalarArgument', ], 'switchBadMethodCallInCase' => [ ' 'InvalidScalarArgument', ], ]; } }