chore: phpstan level 5

This commit is contained in:
Nuno Maduro
2021-11-14 21:39:24 +00:00
parent 183f975166
commit b2cd60395f
11 changed files with 24 additions and 49 deletions

View File

@ -6,7 +6,6 @@ namespace Pest\Support;
use Closure;
use Pest\Exceptions\ShouldNotHappen;
use PHPUnit\Framework\TestCase;
/**
* @internal
@ -19,7 +18,7 @@ final class ChainableClosure
public static function from(Closure $closure, Closure $next): Closure
{
return function () use ($closure, $next): void {
if (! is_object($this)) { // @phpstan-ignore-line
if (!is_object($this)) { // @phpstan-ignore-line
throw ShouldNotHappen::fromMessage('$this not bound to chainable closure.');
}

View File

@ -13,7 +13,7 @@ use Throwable;
*/
final class HigherOrderTapProxy
{
private const UNDEFINED_PROPERTY = 'Undefined property: P\\';
private const UNDEFINED_PROPERTY = 'Undefined property: P\\'; // @phpstan-ignore-line
/**
* Create a new tap proxy instance.
@ -42,9 +42,8 @@ final class HigherOrderTapProxy
public function __get(string $property)
{
try {
/** @throws Throwable */
return $this->target->{$property}; // @phpstan-ignore-line
} catch (Throwable $throwable) {
} catch (Throwable $throwable) { // @phpstan-ignore-line
Reflection::setPropertyValue($throwable, 'file', Backtrace::file());
Reflection::setPropertyValue($throwable, 'line', Backtrace::line());