diff --git a/rector.php b/rector.php index 50a29492..0a0674ad 100644 --- a/rector.php +++ b/rector.php @@ -2,45 +2,21 @@ declare(strict_types=1); -use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector; -use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector; -use Rector\CodingStyle\Rector\Closure\StaticClosureRector; use Rector\Config\RectorConfig; use Rector\Php81\Rector\Array_\FirstClassCallableRector; -use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; use Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_81, - SetList::CODE_QUALITY, - SetList::CODING_STYLE, - SetList::DEAD_CODE, - SetList::NAMING, - SetList::PRIVATIZATION, - SetList::TYPE_DECLARATION, - SetList::STRICT_BOOLEANS, - ]); - - $rectorConfig->parallel(); - $rectorConfig->paths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/spec', __FILE__]); - $rectorConfig->importNames(); - $rectorConfig->removeUnusedImports(); - $rectorConfig->skip([ +return RectorConfig::configure() + ->withPhpSets() + ->withPreparedSets(codeQuality: true, codingStyle: true, deadCode: true, naming: true, privatization: true, typeDeclarations: true, strictBooleans: true) + ->withPaths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/spec', __FILE__]) + ->withImportNames(removeUnusedImports: true) + ->withSkip([ __DIR__ . '/src/Controller', __DIR__ . '/src/Command/Preview', __DIR__ . '/src/Middleware/Routed/Preview', - CallableThisArrayToAnonymousFunctionRector::class, - StaticArrowFunctionRector::class => [ - __DIR__ . '/spec', - ], - StaticClosureRector::class => [ - __DIR__ . '/spec', - ], FirstClassCallableRector::class, BooleanInBooleanNotRuleFixerRector::class => [ __DIR__ . '/src/Handler/Logging.php', ], ]); -}; diff --git a/spec/Middleware/MezzioSpec.php b/spec/Middleware/MezzioSpec.php index ad70a737..73dc3b4b 100644 --- a/spec/Middleware/MezzioSpec.php +++ b/spec/Middleware/MezzioSpec.php @@ -237,8 +237,8 @@ allow($handler)->toReceive('handle')->with($this->request)->andReturn(new Response()); $middleware = new Mezzio($config, $this->logging, $this->renderer); - $actual = $middleware->process($this->request, $handler); - expect($actual)->toBeAnInstanceOf(ResponseInterface::class); + $response = $middleware->process($this->request, $handler); + expect($response)->toBeAnInstanceOf(ResponseInterface::class); }); @@ -276,10 +276,10 @@ }); $middleware = new Mezzio($config, $logging, $this->renderer); - $actual = $middleware->process($this->request, $handler); - expect($actual)->toBeAnInstanceOf(Response::class); + $response = $middleware->process($this->request, $handler); + expect($response)->toBeAnInstanceOf(Response::class); - $content = $actual->getBody()->__toString(); + $content = $response->getBody()->__toString(); expect($content)->toContain('
We have encountered a problem and we can not fulfill your request');
@@ -335,9 +335,9 @@
});
$middleware = new Mezzio($config, $logging, null);
- $actual = $middleware->process($request, $handler);
- expect($actual)->toBeAnInstanceOf(Response::class);
- expect($actual->getBody()->__toString())->toBe(<<