From 688366295172835f7d5a713a4e8d7b36b8815908 Mon Sep 17 00:00:00 2001 From: smoench Date: Mon, 21 Sep 2020 13:44:03 +0200 Subject: [PATCH] update tools --- .phive/phars.xml | 10 +++++----- phpstan.neon.dist | 2 +- .../AstParser/NikicPhpParser/ClassReferenceVisitor.php | 2 +- .../AstParser/NikicPhpParser/NikicPhpParser.php | 2 +- src/Collector/MethodCollector.php | 4 ++-- src/OutputFormatter/XMLOutputFormatter.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.phive/phars.xml b/.phive/phars.xml index a7869cbaf..598ebc7e4 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,8 +1,8 @@ - - - - - + + + + + diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 9ba78ad15..f108a438b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -4,4 +4,4 @@ parameters: level: max paths: [src] ignoreErrors: - - '/Parameter #1 $id of method Fhaculty\Graph\Graph::createVertex() expects int|null, string given./' + - '/Parameter #1 \$id of method Fhaculty\Graph\Graph::createVertex\(\) expects int\|null, string given./' diff --git a/src/AstRunner/AstParser/NikicPhpParser/ClassReferenceVisitor.php b/src/AstRunner/AstParser/NikicPhpParser/ClassReferenceVisitor.php index 050dd84c8..24882a8b3 100644 --- a/src/AstRunner/AstParser/NikicPhpParser/ClassReferenceVisitor.php +++ b/src/AstRunner/AstParser/NikicPhpParser/ClassReferenceVisitor.php @@ -43,7 +43,7 @@ public function enterNode(Node $node) return null; } - if (isset($node->namespacedName) && $node->namespacedName instanceof Node\Name) { + if (isset($node->namespacedName)) { $className = $node->namespacedName->toCodeString(); } elseif ($node->name instanceof Node\Identifier) { $className = $node->name->toString(); diff --git a/src/AstRunner/AstParser/NikicPhpParser/NikicPhpParser.php b/src/AstRunner/AstParser/NikicPhpParser/NikicPhpParser.php index d2238cac8..ee825da3b 100644 --- a/src/AstRunner/AstParser/NikicPhpParser/NikicPhpParser.php +++ b/src/AstRunner/AstParser/NikicPhpParser/NikicPhpParser.php @@ -111,7 +111,7 @@ static function (Node $node): bool { $classLikeNodes = $findingVisitor->getFoundNodes(); foreach ($classLikeNodes as $classLikeNode) { - if (isset($classLikeNode->namespacedName) && $classLikeNode->namespacedName instanceof Node\Name) { + if (isset($classLikeNode->namespacedName)) { $className = $classLikeNode->namespacedName->toString(); } else { $className = (string) $classLikeNode->name; diff --git a/src/Collector/MethodCollector.php b/src/Collector/MethodCollector.php index 1f4d17c69..65f9f87b5 100644 --- a/src/Collector/MethodCollector.php +++ b/src/Collector/MethodCollector.php @@ -24,13 +24,13 @@ public function getType(): string public function satisfy( array $configuration, - AstClassReference $classReference, + AstClassReference $astClassReference, AstMap $astMap, Registry $collectorRegistry ): bool { $pattern = $this->getPattern($configuration); - $classLike = $this->nikicPhpParser->getAstForClassReference($classReference); + $classLike = $this->nikicPhpParser->getAstForClassReference($astClassReference); if (null === $classLike) { return false; diff --git a/src/OutputFormatter/XMLOutputFormatter.php b/src/OutputFormatter/XMLOutputFormatter.php index 96eed77be..9e859d909 100644 --- a/src/OutputFormatter/XMLOutputFormatter.php +++ b/src/OutputFormatter/XMLOutputFormatter.php @@ -39,11 +39,11 @@ public function enabledByDefault(): bool * @throws \Exception */ public function finish( - Context $dependencyContext, + Context $context, OutputInterface $output, OutputFormatterInput $outputFormatterInput ): void { - $xml = $this->createXml($dependencyContext); + $xml = $this->createXml($context); if ($dumpXmlPath = $outputFormatterInput->getOption(self::DUMP_XML)) { file_put_contents($dumpXmlPath, $xml);