Skip to content

Fix ci issues #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 5 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion phive.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpunit" version="^8.4" installed="8.4.3" location="./tools/phpunit" copy="true"/>
<phar name="psalm" version="^3.7.2" installed="3.9.3" location="./tools/psalm" copy="true"/>
<phar name="psalm" version="^3.7.2" installed="3.11.2" location="./tools/psalm" copy="true"/>
</phive>
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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#'
16 changes: 5 additions & 11 deletions src/TypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -160,8 +158,6 @@ public function resolve(string $type, ?Context $context = null) : Type
* @param ArrayIterator<int, string|null> $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
{
Expand All @@ -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'
Expand Down Expand Up @@ -428,9 +426,7 @@ private function resolveTypedObject(string $type, ?Context $context = null) : Ob
/**
* Resolves class string
*
* @param ArrayIterator<int, null|string> $tokens
*
* @psalm-pure
* @param ArrayIterator<int, (string|null)> $tokens
*/
private function resolveClassString(ArrayIterator $tokens, Context $context) : Type
{
Expand Down Expand Up @@ -463,11 +459,9 @@ private function resolveClassString(ArrayIterator $tokens, Context $context) : T
/**
* Resolves the collection values and keys
*
* @param ArrayIterator<int, null|string> $tokens
* @param ArrayIterator<int, (string|null)> $tokens
*
* @return Array_|Iterable_|Collection
*
* @psalm-mutation-free
*/
private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context) : Type
{
Expand Down
2 changes: 0 additions & 2 deletions src/Types/ContextFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
* Fully Qualified names.
*
* @see Context for more information.
*
* @psalm-immutable
*/
final class ContextFactory
{
Expand Down