diff --git a/src/Controller/Api/TestController.php b/src/Controller/Api/TestController.php index 5da60aa..d5abb8b 100644 --- a/src/Controller/Api/TestController.php +++ b/src/Controller/Api/TestController.php @@ -18,7 +18,7 @@ use Shopware\Core\PlatformRequest; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; #[Route(defaults: ['_routeScope' => ['api']])] class TestController diff --git a/src/Core/Media/ExtendedUrlParams.php b/src/Core/Media/ExtendedUrlParams.php index 8ccfb11..f713d69 100644 --- a/src/Core/Media/ExtendedUrlParams.php +++ b/src/Core/Media/ExtendedUrlParams.php @@ -45,7 +45,7 @@ public static function fromThumbnail(Entity $entity): self $mediaUrlParam = $entity->getTranslation('mediaUrlParam'); if (!($mediaUrlParam instanceof ExtendedUrlParam)) { throw new \InvalidArgumentException( - \sprintf('"mediaUrlParam" within translations must be type of "%s"', __CLASS__) + \sprintf('"mediaUrlParam" within translations must be type of "%s"', self::class) ); } diff --git a/src/DependencyInjection/GeneratorCompilerPass.php b/src/DependencyInjection/GeneratorCompilerPass.php index 041d2c0..3069580 100644 --- a/src/DependencyInjection/GeneratorCompilerPass.php +++ b/src/DependencyInjection/GeneratorCompilerPass.php @@ -2,6 +2,8 @@ namespace Frosh\ThumbnailProcessor\DependencyInjection; +use PhpParser\Node\Stmt\UseUse; +use PhpParser\Node\Stmt\Use_; use PhpParser\Comment\Doc; use PhpParser\Node\Expr\Assign; use PhpParser\Node\Expr\ConstFetch; @@ -175,14 +177,14 @@ private function addUsesOfNamespace(?array &$stmts, string $namespace): void continue; } - $uses[] = new Stmt\UseUse(new Name($class)); + $uses[] = new UseUse(new Name($class)); } if (empty($uses)) { return; } - array_unshift($stmts, new Stmt\Use_($uses)); + array_unshift($stmts, new Use_($uses)); } private function getFileContent(): ?string diff --git a/src/Service/ConfigReader.php b/src/Service/ConfigReader.php index 9d77919..fd058f1 100644 --- a/src/Service/ConfigReader.php +++ b/src/Service/ConfigReader.php @@ -9,7 +9,7 @@ class ConfigReader { - private ?string $salesChannelId; + private ?string $salesChannelId = null; private bool $salesChannelIdDetected = false;