From 64c6e28a0e5de40de60e809dee6104d6fcbd78de Mon Sep 17 00:00:00 2001 From: Sonata CI Date: Mon, 15 Jul 2024 08:30:20 +0100 Subject: [PATCH] DevKit updates for 4.x branch (#8195) Co-authored-by: Vincent Langlet --- rector.php | 2 -- src/Admin/AbstractAdmin.php | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/rector.php b/rector.php index 93a605cc63..b6dac16fc2 100644 --- a/rector.php +++ b/rector.php @@ -19,7 +19,6 @@ use Rector\Config\RectorConfig; use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector; -use Rector\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector; use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\LevelSetList; @@ -40,7 +39,6 @@ $rectorConfig->importShortClasses(false); $rectorConfig->skip([ ExceptionHandlerTypehintRector::class, - AddSeeTestAnnotationRector::class, PreferPHPUnitThisCallRector::class, ]); }; diff --git a/src/Admin/AbstractAdmin.php b/src/Admin/AbstractAdmin.php index 98e653519a..7844c990ba 100644 --- a/src/Admin/AbstractAdmin.php +++ b/src/Admin/AbstractAdmin.php @@ -1840,7 +1840,7 @@ protected function generateBaseRoutePattern(bool $isChildAdmin = false): string preg_match(self::CLASS_REGEX, $this->getModelClass(), $matches); - if ([] === $matches) { + if (!isset($matches[1], $matches[3], $matches[5])) { throw new \LogicException(sprintf( 'Please define a default `baseRoutePattern` value for the admin class `%s`', static::class @@ -1877,7 +1877,7 @@ protected function generateBaseRouteName(bool $isChildAdmin = false): string preg_match(self::CLASS_REGEX, $this->getModelClass(), $matches); - if ([] === $matches) { + if (!isset($matches[1], $matches[3], $matches[5])) { throw new \LogicException(sprintf( 'Cannot automatically determine base route name,' .' please define a default `baseRouteName` value for the admin class `%s`',