Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 11, 2024
1 parent 23e29a4 commit 2632168
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ services:
-
class: Composer\Pcre\PHPStan\PregMatchParameterOutTypeExtension
-
class: Composer\Pcre\PHPStan\PregMatchTypeSpecifyingExtension
class: Composer\Pcre\PHPStan\PregMatchTypeSpecifyingExtension
4 changes: 2 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ parameters:
reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false

ignoreErrors:
- '#Test::data[a-zA-Z0-9_]+\(\) return type has no value type specified in iterable type#'
bootstrapFiles:
- tests/phpstan-locate-phpunit-autoloader.php

excludePaths:
- tests/PHPStanTests/nsrt/*
Expand Down
2 changes: 1 addition & 1 deletion src/PHPStan/PregMatchFlags.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ static public function getType(?Arg $flagsArg, Scope $scope): ?Type
}
return TypeCombinator::union(...$internalFlagsTypes);
}
}
}
2 changes: 0 additions & 2 deletions src/PHPStan/PregMatchTypeSpecifyingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function __construct(
$this->regexShapeMatcher = $regexShapeMatcher;
}


public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void
{
$this->typeSpecifier = $typeSpecifier;
Expand Down Expand Up @@ -83,5 +82,4 @@ public function specifyTypes(MethodReflection $methodReflection, StaticCall $nod
$node,
);
}

}
12 changes: 7 additions & 5 deletions tests/PHPStanTests/TypeInferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@

class TypeInferenceTest extends TypeInferenceTestCase
{
/**
* @return mixed
*/
public function dataFileAsserts(): iterable
{
yield from $this->gatherAssertTypesFromDirectory(__DIR__ . '/nsrt');

}

/**
Expand All @@ -28,9 +30,9 @@ public function dataFileAsserts(): iterable
public function testFileAsserts(
string $assertType,
string $file,
...$args
): void
{
...$args
): void
{
$this->assertFileAsserts($assertType, $file, ...$args);
}

Expand All @@ -41,4 +43,4 @@ public static function getAdditionalConfigFiles(): array
__DIR__ . '/../../extension.neon',
];
}
}
}
2 changes: 1 addition & 1 deletion tests/PHPStanTests/nsrt/preg-match.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ function equalMatch(string $s): void
assertType('array{}', $matches);
}
assertType('array{}|array{string}', $matches);
}
}

0 comments on commit 2632168

Please sign in to comment.