diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 183dc0c4..58b54aab 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -6,6 +6,7 @@ ->setRiskyAllowed(false) ->setRules([ '@PER-CS' => true, + 'array_syntax' => false, 'braces_position' => [ 'control_structures_opening_brace' => 'same_line', ], diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1550ef85..e1120efb 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5,11 +5,6 @@ parameters: count: 2 path: src/Prophecy/Argument/Token/ExactValueToken.php - - - message: "#^Method Prophecy\\\\Call\\\\CallCenter\\:\\:indentArguments\\(\\) should return array\\ but returns array\\\\|null\\.$#" - count: 1 - path: src/Prophecy/Call/CallCenter.php - - message: "#^Method Prophecy\\\\Doubler\\\\CachedDoubler\\:\\:createDoubleClass\\(\\) should return class\\-string\\ but returns class\\-string\\.$#" count: 1 diff --git a/spec/Prophecy/Prediction/CallbackPredictionSpec.php b/spec/Prophecy/Prediction/CallbackPredictionSpec.php index c234f43b..2742789a 100644 --- a/spec/Prophecy/Prediction/CallbackPredictionSpec.php +++ b/spec/Prophecy/Prediction/CallbackPredictionSpec.php @@ -3,7 +3,6 @@ namespace spec\Prophecy\Prediction; use PhpSpec\ObjectBehavior; - use Prophecy\Call\Call; use Prophecy\Prophecy\MethodProphecy; use Prophecy\Prophecy\ObjectProphecy; diff --git a/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php b/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php index 50299e7d..98b2f496 100644 --- a/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php +++ b/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php @@ -79,13 +79,13 @@ public function apply(ClassNode $node) if (in_array($methodName, self::MAGIC_METHODS_WITH_ARGUMENTS)) { if (method_exists($tag, 'getParameters')) { // Reflection Docblock 5.4.0+. - foreach($tag->getParameters() as $argument) { + foreach ($tag->getParameters() as $argument) { $argumentNode = new ArgumentNode($argument->getName()); $methodNode->addArgument($argumentNode); } } else { // Reflection Docblock < 5.4.0. - foreach($tag->getArguments() as $argument) { + foreach ($tag->getArguments() as $argument) { $argumentNode = new ArgumentNode($argument['name']); $methodNode->addArgument($argumentNode); } diff --git a/src/Prophecy/Doubler/Generator/ClassMirror.php b/src/Prophecy/Doubler/Generator/ClassMirror.php index 5a6f0d0e..94b2a830 100644 --- a/src/Prophecy/Doubler/Generator/ClassMirror.php +++ b/src/Prophecy/Doubler/Generator/ClassMirror.php @@ -255,7 +255,7 @@ private function getTypeHints(?ReflectionType $type, ReflectionClass $class, boo } } elseif ($type instanceof ReflectionIntersectionType) { throw new ClassMirrorException('Doubling intersection types is not supported', $class); - } elseif(is_object($type)) { + } elseif (is_object($type)) { throw new ClassMirrorException('Unknown reflection type '.get_class($type), $class); } diff --git a/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php b/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php index 7b615352..211dc1b2 100644 --- a/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php +++ b/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php @@ -54,7 +54,7 @@ private function getInterfacesTagList(\ReflectionClass $reflectionClass) $interfaces = $reflectionClass->getInterfaces(); $tagList = array(); - foreach($interfaces as $interface) { + foreach ($interfaces as $interface) { $tagList = array_merge($tagList, $this->classRetriever->getTagList($interface)); } diff --git a/src/Prophecy/Prophecy/MethodProphecy.php b/src/Prophecy/Prophecy/MethodProphecy.php index 972efb8d..cefe5e39 100644 --- a/src/Prophecy/Prophecy/MethodProphecy.php +++ b/src/Prophecy/Prophecy/MethodProphecy.php @@ -132,9 +132,9 @@ static function (string $type1, string $type2) { return class_exists($type) || interface_exists($type); }; - if($isObject($type1) && !$isObject($type2)) { + if ($isObject($type1) && !$isObject($type2)) { return -1; - } elseif(!$isObject($type1) && $isObject($type2)) { + } elseif (!$isObject($type1) && $isObject($type2)) { return 1; }