From 9e06ef69059065ebe21107741781263d9008cdf8 Mon Sep 17 00:00:00 2001 From: Jaapio Date: Mon, 27 Apr 2020 10:09:20 +0200 Subject: [PATCH 1/3] Fix ci issues --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c1f9caf..a8a6b51 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ .PHONY: install-phive install-phive: mkdir tools; \ - wget -O tools/phive.phar https://phar.io/releases/phive.phar; \ - wget -O tools/phive.phar.asc https://phar.io/releases/phive.phar.asc; \ + wget -O tools/phive.phar https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar; \ + wget -O tools/phive.phar.asc https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar.asc; \ gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79; \ gpg --verify tools/phive.phar.asc tools/phive.phar; \ chmod +x tools/phive.phar From 113fbeffd6c6ab7e70ef1cb956f6ee913a96aa4b Mon Sep 17 00:00:00 2001 From: Jaapio Date: Mon, 27 Apr 2020 10:44:09 +0200 Subject: [PATCH 2/3] Fix analisys issues --- phive.xml | 2 +- phpstan.neon | 3 --- src/TypeResolver.php | 16 +++++----------- src/Types/ContextFactory.php | 2 -- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/phive.xml b/phive.xml index ae599e8..b82f7d0 100644 --- a/phive.xml +++ b/phive.xml @@ -1,5 +1,5 @@ - + diff --git a/phpstan.neon b/phpstan.neon index be245fa..995090a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,6 +5,3 @@ parameters: # Bug in PHPStan? The error is "expects A, A given" - '#Parameter \#1 \$tokens of method phpDocumentor\\Reflection\\Types\\ContextFactory::parse#' # ArrayIterator::current can return null if iterated even if ArrayIterator::valid isn't checked before - - '#Strict comparison using === between array\(int, string, int\)\|string and false will always evaluate to false#' - - '#Strict comparison using === between string and null will always evaluate to false#' - - '#Unreachable statement - code above always terminates#' \ No newline at end of file diff --git a/src/TypeResolver.php b/src/TypeResolver.php index 5777f67..1b4e7ba 100644 --- a/src/TypeResolver.php +++ b/src/TypeResolver.php @@ -122,8 +122,6 @@ public function __construct(?FqsenResolver $fqsenResolver = null) * @uses Context::getNamespace() to determine with what to prefix the type name. * * @param string $type The relative or absolute type. - * - * @psalm-pure */ public function resolve(string $type, ?Context $context = null) : Type { @@ -160,8 +158,6 @@ public function resolve(string $type, ?Context $context = null) : Type * @param ArrayIterator $tokens the iterator on tokens * @param int $parserContext on of self::PARSER_* constants, indicating * the context where we are in the parsing - * - * @psalm-pure */ private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext) : Type { @@ -173,7 +169,9 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser throw new RuntimeException( 'Unexpected nullable character' ); - } elseif ($token === '|') { + } + + if ($token === '|') { if (count($types) === 0) { throw new RuntimeException( 'A type is missing before a type separator' @@ -428,9 +426,7 @@ private function resolveTypedObject(string $type, ?Context $context = null) : Ob /** * Resolves class string * - * @param ArrayIterator $tokens - * - * @psalm-pure + * @param ArrayIterator $tokens */ private function resolveClassString(ArrayIterator $tokens, Context $context) : Type { @@ -463,11 +459,9 @@ private function resolveClassString(ArrayIterator $tokens, Context $context) : T /** * Resolves the collection values and keys * - * @param ArrayIterator $tokens + * @param ArrayIterator $tokens * * @return Array_|Iterable_|Collection - * - * @psalm-mutation-free */ private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context) : Type { diff --git a/src/Types/ContextFactory.php b/src/Types/ContextFactory.php index c0c58b3..596cf61 100644 --- a/src/Types/ContextFactory.php +++ b/src/Types/ContextFactory.php @@ -47,8 +47,6 @@ * Fully Qualified names. * * @see Context for more information. - * - * @psalm-immutable */ final class ContextFactory { From 97228be84563578e0341e81fd3e72abe6f86af9b Mon Sep 17 00:00:00 2001 From: Jaapio Date: Mon, 27 Apr 2020 11:39:49 +0200 Subject: [PATCH 3/3] Bump phpdocumentor/reflection-common to 2.1.0 --- composer.lock | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index f6fde1a..4e37f40 100644 --- a/composer.lock +++ b/composer.lock @@ -8,24 +8,21 @@ "packages": [ { "name": "phpdocumentor/reflection-common", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", "shasum": "" }, "require": { "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "~6" - }, "type": "library", "extra": { "branch-alias": { @@ -56,7 +53,7 @@ "reflection", "static analysis" ], - "time": "2018-08-07T13:53:10+00:00" + "time": "2020-04-27T09:25:28+00:00" } ], "packages-dev": [