Skip to content

Commit

Permalink
Fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-ritti committed Apr 15, 2022
1 parent 0469c85 commit 438cb3f
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 58 deletions.
11 changes: 5 additions & 6 deletions config/packages/webpack_encore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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
15 changes: 7 additions & 8 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}": [
Expand Down
16 changes: 7 additions & 9 deletions src/Controller/API/CookieController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand Down
6 changes: 0 additions & 6 deletions src/Controller/Admin/InspectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public function index(): Response
throw new NotFoundHttpException();
}

/**
* @throws Exception
*/
/**
* @throws Exception
*/
Expand All @@ -56,9 +53,6 @@ public function inspect(string $bin): Response
]);
}

/**
* @throws Exception
*/
/**
* @throws Exception
*/
Expand Down
10 changes: 4 additions & 6 deletions src/Dto/Bin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace App\Dto;

use JetBrains\PhpStorm\Pure;
use Stringable;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Uid\Uuid;
Expand All @@ -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
{
Expand Down
39 changes: 17 additions & 22 deletions src/Dto/RequestBin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use DateTimeImmutable;
use DateTimeInterface;
use Exception;
use JetBrains\PhpStorm\Pure;
use Symfony\Component\HttpFoundation\Request;

class RequestBin
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 438cb3f

Please sign in to comment.