diff --git a/config/packages/webpack_encore.yaml b/config/packages/webpack_encore.yaml index c9c94e5..b30abc1 100644 --- a/config/packages/webpack_encore.yaml +++ b/config/packages/webpack_encore.yaml @@ -11,8 +11,8 @@ webpack_encore: # https://turbo.hotwired.dev/handbook/drive#reloading-when-assets-change # 'data-turbo-track': reload # link_attributes: - # Uncomment if using Turbo Drive - # 'data-turbo-track': reload + # Uncomment if using Turbo Drive + # 'data-turbo-track': reload # If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials') crossorigin: 'anonymous' @@ -25,10 +25,10 @@ webpack_encore: # If you have multiple builds: # builds: - # pass "frontend" as the 3rg arg to the Twig functions - # {{ encore_entry_script_tags('entry1', null, 'frontend') }} + # pass "frontend" as the 3rg arg to the Twig functions + # {{ encore_entry_script_tags('entry1', null, 'frontend') }} - # frontend: '%kernel.project_dir%/public/frontend/build' + # frontend: '%kernel.project_dir%/public/frontend/build' # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes) # Put in config/packages/prod/webpack_encore.yaml @@ -43,7 +43,6 @@ when@prod: # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes) # Available in version 1.2 cache: true - #when@test: # webpack_encore: # strict_mode: false diff --git a/config/services.yaml b/config/services.yaml index 7fe2346..e48920e 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -4,14 +4,14 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration parameters: - buckets_dirs : '%kernel.project_dir%/var/bins' + buckets_dirs: '%kernel.project_dir%/var/bins' bucket_mode: '%env(default:default_bucket_mode:BUCKET_MODE)%' default_bucket_mode: 'path' services: # default configuration for services in *this* file _defaults: - autowire: true # Automatically injects dependencies in your services. + autowire: true # Automatically injects dependencies in your services. autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. # makes classes in src/ available to be used as services @@ -28,7 +28,7 @@ services: App\Controller\: resource: '../src/Controller/' - tags: [ 'controller.service_arguments' ] + tags: ['controller.service_arguments'] App\OpenApi\OpenApiFactory: decorates: 'api_platform.openapi.factory' @@ -39,20 +39,19 @@ services: app.menu_builder: class: App\Menu\Builder - arguments: ["@knp_menu.factory"] + arguments: ['@knp_menu.factory'] tags: - { name: knp_menu.menu_builder, method: createMainMenu, alias: main } bin_manager: class: App\Manager\BinManager - App\EventListener\CurrentBinEventSubscriber: arguments: - - "@bin_manager" - - "%bucket_mode%" + - '@bin_manager' + - '%bucket_mode%' tags: - - { name: kernel.event_subscriber} + - { name: kernel.event_subscriber } current_bin_listener: alias: App\EventListener\CurrentBinEventSubscriber diff --git a/package.json b/package.json index 92b2f1c..37e4ffe 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "lint-staged": { "*.php": [ "vendor/bin/php-cs-fixer fix --diff --config .php-cs-fixer.dist.php --no-ansi", - "vendor/bin/phpcs --no-colors", "vendor/bin/phpstan analyse --no-ansi --no-progress" ], "*.{js,jsx,ts,tsx,vue}": [ diff --git a/src/Controller/API/CookieController.php b/src/Controller/API/CookieController.php index facc691..2a818b6 100644 --- a/src/Controller/API/CookieController.php +++ b/src/Controller/API/CookieController.php @@ -13,7 +13,6 @@ use App\Dto\Errors\FormErrorItemRfc7807DTO; use App\Dto\Errors\FormErrorRfc7807DTO; use ArrayObject; -use JetBrains\PhpStorm\Pure; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -230,15 +229,14 @@ public static function setupOpenApiDocumentation(OpenApi $openApi): void $openApi->getPaths()->addPath('/cookies/{key}', $singleItem); } - #[Pure] - private function createErrorFromSerialization(): FormErrorRfc7807DTO - { - $mainDto = new FormErrorRfc7807DTO(); - $mainDto->title = 'Bad Request'; - $mainDto->type = 'Missing JSON node'; + private function createErrorFromSerialization(): FormErrorRfc7807DTO + { + $mainDto = new FormErrorRfc7807DTO(); + $mainDto->title = 'Bad Request'; + $mainDto->type = 'Missing JSON node'; - return $mainDto; - } + return $mainDto; + } private function createErrorFromValidation(ConstraintViolationListInterface $violations): FormErrorRfc7807DTO { diff --git a/src/Controller/Admin/InspectController.php b/src/Controller/Admin/InspectController.php index e91b87a..30d99c0 100644 --- a/src/Controller/Admin/InspectController.php +++ b/src/Controller/Admin/InspectController.php @@ -35,9 +35,6 @@ public function index(): Response throw new NotFoundHttpException(); } - /** - * @throws Exception - */ /** * @throws Exception */ @@ -56,9 +53,6 @@ public function inspect(string $bin): Response ]); } - /** - * @throws Exception - */ /** * @throws Exception */ diff --git a/src/Dto/Bin.php b/src/Dto/Bin.php index 38039ba..22fd389 100644 --- a/src/Dto/Bin.php +++ b/src/Dto/Bin.php @@ -4,7 +4,6 @@ namespace App\Dto; -use JetBrains\PhpStorm\Pure; use Stringable; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Uid\Uuid; @@ -19,11 +18,10 @@ public function __construct(private string $id) } } - #[Pure] - public function __toString(): string - { - return $this->getId(); - } + public function __toString(): string + { + return $this->getId(); + } public function getId(): string { diff --git a/src/Dto/RequestBin.php b/src/Dto/RequestBin.php index a088e30..86b1015 100644 --- a/src/Dto/RequestBin.php +++ b/src/Dto/RequestBin.php @@ -7,7 +7,6 @@ use DateTimeImmutable; use DateTimeInterface; use Exception; -use JetBrains\PhpStorm\Pure; use Symfony\Component\HttpFoundation\Request; class RequestBin @@ -45,26 +44,22 @@ public static function createFromRequest(Request $request): RequestBin /** * @throws Exception */ - /** - * @throws Exception - */ - #[Pure] - public static function createFromArray(array $data): RequestBin - { - $dto = new self(); - $dto->id = $data['id'] ?? null; - $dto->method = $data['method'] ?? null; - $dto->origins = $data['origins'] ? unserialize($data['origins'], ['allowed_classes' => false]) : null; - $dto->contentType = $data['content_type'] ?? null; - $dto->contentLength = $data['content_length'] ?? null; - $dto->host = $data['host'] ?? null; - $dto->path = $data['path'] ?? null; - $dto->queryArgs = $data['query_args'] ? unserialize($data['query_args'], ['allowed_classes' => false]) : null; - $dto->headers = $data['headers'] ? unserialize($data['headers'], ['allowed_classes' => false]) : null; - $dto->rawBody = $data['raw_body'] ?? null; - $dto->body = $data['body'] ? unserialize($data['body'], ['allowed_classes' => false]) : null; - $dto->date = $data['date'] ? new DateTimeImmutable($data['date']) : null; + public static function createFromArray(array $data): RequestBin + { + $dto = new self(); + $dto->id = $data['id'] ?? null; + $dto->method = $data['method'] ?? null; + $dto->origins = $data['origins'] ? unserialize($data['origins'], ['allowed_classes' => false]) : null; + $dto->contentType = $data['content_type'] ?? null; + $dto->contentLength = $data['content_length'] ?? null; + $dto->host = $data['host'] ?? null; + $dto->path = $data['path'] ?? null; + $dto->queryArgs = $data['query_args'] ? unserialize($data['query_args'], ['allowed_classes' => false]) : null; + $dto->headers = $data['headers'] ? unserialize($data['headers'], ['allowed_classes' => false]) : null; + $dto->rawBody = $data['raw_body'] ?? null; + $dto->body = $data['body'] ? unserialize($data['body'], ['allowed_classes' => false]) : null; + $dto->date = $data['date'] ? new DateTimeImmutable($data['date']) : null; - return $dto; - } + return $dto; + } }