From 854d72fa425590985bdbffc506a7764bef2a5de9 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 22 May 2024 17:12:49 +0200 Subject: [PATCH] php cs fixes --- .../Dav/Exception/ParseRequestException.php | 4 +--- .../Security/Guard/DavOnUrlTokenExtractor.php | 3 +-- .../Security/Guard/JWTDavTokenProvider.php | 3 +-- .../Security/Guard/JWTOnDavUrlAuthenticator.php | 2 +- .../Templating/WopiEditTwigExtensionRuntime.php | 3 +-- .../Tests/Controller/WebdavControllerTest.php | 4 +--- .../Tests/Security/Authorization/StoredObjectVoterTest.php | 4 ++-- src/Bundle/ChillJobBundle/src/Entity/CSPerson.php | 6 +++--- src/Bundle/ChillJobBundle/src/Entity/Immersion.php | 4 +--- .../src/Form/Type/PickRomeAppellationType.php | 2 +- 10 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Dav/Exception/ParseRequestException.php b/src/Bundle/ChillDocStoreBundle/Dav/Exception/ParseRequestException.php index 70fff1866..0c740be17 100644 --- a/src/Bundle/ChillDocStoreBundle/Dav/Exception/ParseRequestException.php +++ b/src/Bundle/ChillDocStoreBundle/Dav/Exception/ParseRequestException.php @@ -11,6 +11,4 @@ declare(strict_types=1); namespace Chill\DocStoreBundle\Dav\Exception; -class ParseRequestException extends \UnexpectedValueException -{ -} +class ParseRequestException extends \UnexpectedValueException {} diff --git a/src/Bundle/ChillDocStoreBundle/Security/Guard/DavOnUrlTokenExtractor.php b/src/Bundle/ChillDocStoreBundle/Security/Guard/DavOnUrlTokenExtractor.php index 543996f57..3881c6251 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Guard/DavOnUrlTokenExtractor.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Guard/DavOnUrlTokenExtractor.php @@ -27,8 +27,7 @@ final readonly class DavOnUrlTokenExtractor implements TokenExtractorInterface { public function __construct( private LoggerInterface $logger, - ) { - } + ) {} public function extract(Request $request): false|string { diff --git a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTDavTokenProvider.php b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTDavTokenProvider.php index 24e89a3ba..0bd0cdb8e 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTDavTokenProvider.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTDavTokenProvider.php @@ -24,8 +24,7 @@ final readonly class JWTDavTokenProvider implements JWTDavTokenProviderInterface public function __construct( private JWTTokenManagerInterface $JWTTokenManager, private Security $security, - ) { - } + ) {} public function createToken(StoredObject $storedObject, StoredObjectRoleEnum $roleEnum): string { diff --git a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php index 7695fb635..fe8ba2b73 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php @@ -29,7 +29,7 @@ class JWTOnDavUrlAuthenticator extends JWTTokenAuthenticator TokenExtractorInterface $tokenExtractor, private readonly DavOnUrlTokenExtractor $davOnUrlTokenExtractor, TokenStorageInterface $preAuthenticationTokenStorage, - TranslatorInterface $translator = null, + ?TranslatorInterface $translator = null, ) { parent::__construct($jwtManager, $dispatcher, $tokenExtractor, $preAuthenticationTokenStorage, $translator); } diff --git a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php index 3b6c32148..716cb422e 100644 --- a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php @@ -128,8 +128,7 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt private NormalizerInterface $normalizer, private JWTDavTokenProviderInterface $davTokenProvider, private UrlGeneratorInterface $urlGenerator, - ) { - } + ) {} /** * return true if the document is editable. diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Controller/WebdavControllerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Controller/WebdavControllerTest.php index 9254efc2d..fab84ce7f 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Controller/WebdavControllerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Controller/WebdavControllerTest.php @@ -399,9 +399,7 @@ class MockedStoredObjectManager implements StoredObjectManagerInterface return 'abcde'; } - public function write(StoredObject $document, string $clearContent): void - { - } + public function write(StoredObject $document, string $clearContent): void {} public function etag(StoredObject $document): string { diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/StoredObjectVoterTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/StoredObjectVoterTest.php index 477427078..92c928681 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/StoredObjectVoterTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/StoredObjectVoterTest.php @@ -32,7 +32,7 @@ class StoredObjectVoterTest extends TestCase /** * @dataProvider provideDataVote */ - public function testVote(TokenInterface $token, null|object $subject, string $attribute, mixed $expected): void + public function testVote(TokenInterface $token, ?object $subject, string $attribute, mixed $expected): void { $voter = new StoredObjectVoter(); @@ -98,7 +98,7 @@ class StoredObjectVoterTest extends TestCase ]; } - private function buildToken(StoredObjectRoleEnum $storedObjectRoleEnum = null, StoredObject $storedObject = null): TokenInterface + private function buildToken(?StoredObjectRoleEnum $storedObjectRoleEnum = null, ?StoredObject $storedObject = null): TokenInterface { $token = $this->prophesize(TokenInterface::class); diff --git a/src/Bundle/ChillJobBundle/src/Entity/CSPerson.php b/src/Bundle/ChillJobBundle/src/Entity/CSPerson.php index 012cd62c4..1a2608388 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/CSPerson.php +++ b/src/Bundle/ChillJobBundle/src/Entity/CSPerson.php @@ -113,7 +113,7 @@ class CSPerson 'ASS', 'RSA', 'AAH', -// 'autre', + // 'autre', ]; /** @@ -140,7 +140,7 @@ class CSPerson 'referent_RSA', 'mission_locale', 'rqth', -// 'autre', + // 'autre', ]; /** @@ -226,7 +226,7 @@ class CSPerson 'scooter', 'velo', 'voiture', -// 'autre', + // 'autre', ]; /** diff --git a/src/Bundle/ChillJobBundle/src/Entity/Immersion.php b/src/Bundle/ChillJobBundle/src/Entity/Immersion.php index 75ff04367..5ae19a365 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/Immersion.php +++ b/src/Bundle/ChillJobBundle/src/Entity/Immersion.php @@ -523,12 +523,10 @@ class Immersion implements \Stringable /** * Get duration. - * - * @return \DateInterval */ public function getDuration() { - return new \DateInterval($this->duration); + return $this->duration; } public function getDateEndComputed() diff --git a/src/Bundle/ChillJobBundle/src/Form/Type/PickRomeAppellationType.php b/src/Bundle/ChillJobBundle/src/Form/Type/PickRomeAppellationType.php index 6ae77ba62..174a25c18 100644 --- a/src/Bundle/ChillJobBundle/src/Form/Type/PickRomeAppellationType.php +++ b/src/Bundle/ChillJobBundle/src/Form/Type/PickRomeAppellationType.php @@ -88,7 +88,7 @@ class PickRomeAppellationType extends AbstractType ->setDefault('class', Appellation::class) ->setDefault('choice_label', fn (Appellation $a) => $a->getLibelle()) ->setDefault('placeholder', 'Choisir une appellation') - // ->setDefault('attr', ['class' => 'select2 ']) + ->setDefault('attr', ['class' => 'select2 ']) ->setDefault('choice_loader', fn (Options $o) => new RomeAppellationChoiceLoader( $this->em, $this->apiPartenaire,