Skip to content

Commit 3b13265

Browse files
authored
Merge branch 'master' into patch-1
2 parents 60ebf65 + d6f6df1 commit 3b13265

File tree

6 files changed

+13
-27
lines changed

6 files changed

+13
-27
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.PHONY: install-phive
22
install-phive:
33
mkdir tools; \
4-
wget -O tools/phive.phar http://phar.io/releases/phive.phar; \
5-
wget -O tools/phive.phar.asc http://phar.io/releases/phive.phar.asc; \
4+
wget -O tools/phive.phar http://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar; \
5+
wget -O tools/phive.phar.asc http://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar.asc; \
66
gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79; \
77
gpg --verify tools/phive.phar.asc tools/phive.phar; \
88
chmod +x tools/phive.phar

composer.lock

Lines changed: 5 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phive.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="http://phar.io/phive">
33
<phar name="phpunit" version="^8.4" installed="8.4.3" location="./tools/phpunit" copy="true"/>
4-
<phar name="psalm" version="^3.7.2" installed="3.9.3" location="./tools/psalm" copy="true"/>
4+
<phar name="psalm" version="^3.7.2" installed="3.11.2" location="./tools/psalm" copy="true"/>
55
</phive>

phpstan.neon

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ parameters:
55
# Bug in PHPStan? The error is "expects A, A given"
66
- '#Parameter \#1 \$tokens of method phpDocumentor\\Reflection\\Types\\ContextFactory::parse#'
77
# ArrayIterator::current can return null if iterated even if ArrayIterator::valid isn't checked before
8-
- '#Strict comparison using === between array\(int, string, int\)\|string and false will always evaluate to false#'
9-
- '#Strict comparison using === between string and null will always evaluate to false#'
10-
- '#Unreachable statement - code above always terminates#'

src/TypeResolver.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ public function __construct(?FqsenResolver $fqsenResolver = null)
123123
* @uses Context::getNamespace() to determine with what to prefix the type name.
124124
*
125125
* @param string $type The relative or absolute type.
126-
*
127-
* @psalm-pure
128126
*/
129127
public function resolve(string $type, ?Context $context = null) : Type
130128
{
@@ -161,8 +159,6 @@ public function resolve(string $type, ?Context $context = null) : Type
161159
* @param ArrayIterator<int, string|null> $tokens the iterator on tokens
162160
* @param int $parserContext on of self::PARSER_* constants, indicating
163161
* the context where we are in the parsing
164-
*
165-
* @psalm-pure
166162
*/
167163
private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext) : Type
168164
{
@@ -175,7 +171,9 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser
175171
throw new RuntimeException(
176172
'Unexpected nullable character'
177173
);
178-
} elseif ($token === '|' || $token === '&') {
174+
}
175+
176+
if ($token === '|' || $token === '&') {
179177
if (count($types) === 0) {
180178
throw new RuntimeException(
181179
'A type is missing before a type separator'
@@ -411,9 +409,7 @@ private function resolveTypedObject(string $type, ?Context $context = null) : Ob
411409
/**
412410
* Resolves class string
413411
*
414-
* @param ArrayIterator<int, null|string> $tokens
415-
*
416-
* @psalm-pure
412+
* @param ArrayIterator<int, (string|null)> $tokens
417413
*/
418414
private function resolveClassString(ArrayIterator $tokens, Context $context) : Type
419415
{
@@ -446,11 +442,9 @@ private function resolveClassString(ArrayIterator $tokens, Context $context) : T
446442
/**
447443
* Resolves the collection values and keys
448444
*
449-
* @param ArrayIterator<int, null|string> $tokens
445+
* @param ArrayIterator<int, (string|null)> $tokens
450446
*
451447
* @return Array_|Iterable_|Collection
452-
*
453-
* @psalm-mutation-free
454448
*/
455449
private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context) : Type
456450
{

src/Types/ContextFactory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
* Fully Qualified names.
4848
*
4949
* @see Context for more information.
50-
*
51-
* @psalm-immutable
5250
*/
5351
final class ContextFactory
5452
{

0 commit comments

Comments
 (0)