Update Rector config

This commit is contained in:
Giuseppe Criscione 2024-05-19 21:50:39 +02:00
parent 16f2839aae
commit 0ddfd0da32
3 changed files with 11 additions and 22 deletions

View File

@ -7,24 +7,16 @@ use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
return RectorConfig::configure()
->withPhpSets(php82: true)
->withPreparedSets(deadCode: true, codeQuality: true, earlyReturn: true, naming: true, instanceOf: true)
->withImportNames(importShortClasses: false)
->withPaths([
dirname(__DIR__),
]);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::NAMING,
SetList::INSTANCEOF,
]);
$rectorConfig->skip([
])
->withSkip([
__DIR__ . '/views',
dirname(__DIR__) . '/panel/node_modules',
dirname(__DIR__) . '/panel/views',
@ -34,8 +26,5 @@ return static function (RectorConfig $rectorConfig): void {
ClosureToArrowFunctionRector::class,
CompactToVariablesRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
NullToStrictStringFuncCallArgRector::class,
]);
$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);
};

View File

@ -29,7 +29,7 @@ abstract class AbstractController extends BaseAbstractController
protected ModalCollection $modals;
public function __construct(
private Container $container,
private readonly Container $container,
protected App $app,
protected Config $config,
protected ModalFactory $modalFactory,

View File

@ -265,7 +265,7 @@ final class Panel
{
if ($this->config->get('system.errors.setHandlers')) {
$this->errors = $this->container->build(ErrorsController::class);
set_exception_handler(function (Throwable $throwable): void {
set_exception_handler(function (Throwable $throwable): never {
$this->errors->internalServerError($throwable)->send();
throw $throwable;
});