Skip to content

Commit

Permalink
chore: fixes type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Feb 19, 2023
1 parent 2d9d70d commit 1fd7457
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Adapters/Phpunit/Style.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ private function ignorePestPipes($frame): bool
{
if (class_exists(Expectation::class)) {
$reflection = new ReflectionClass(Expectation::class);

/** @var array<string, array<Closure(Closure, mixed ...$arguments): void>> $expectationPipes */
$expectationPipes = $reflection->getStaticPropertyValue('pipes', []);

foreach ($expectationPipes as $pipes) {
Expand All @@ -466,6 +468,8 @@ private function ignorePestExtends($frame): bool
{
if (class_exists(Expectation::class)) {
$reflection = new ReflectionClass(Expectation::class);

/** @var array<string, Closure> $extends */
$extends = $reflection->getStaticPropertyValue('extends', []);

foreach ($extends as $extendClosure) {
Expand All @@ -485,7 +489,7 @@ private function isFrameInClosure($frame, Closure $closure): bool
{
$reflection = new ReflectionFunction($closure);

$sanitizedPath = (string) str_replace('\\', '/', $frame->getFile());
$sanitizedPath = (string) str_replace('\\', '/', (string) $frame->getFile());

/** @phpstan-ignore-next-line */
$sanitizedClosurePath = (string) str_replace('\\', '/', $reflection->getFileName());
Expand Down

0 comments on commit 1fd7457

Please sign in to comment.