From 5af11e34b3efbde605e05ed9784bd03d454ee78f Mon Sep 17 00:00:00 2001 From: Jonathan Foucher <jfoucher@gmail.com> Date: Thu, 5 Oct 2023 09:34:36 +0200 Subject: [PATCH] cs -fix --- config/packages/framework.yaml | 2 +- src/Application/Traits/Model/CreatorTrait.php | 3 --- src/Domain/AIPD/Controller/AnalyseImpactController.php | 2 +- src/Domain/Maturity/Calculator/Maturity.php | 1 - src/Domain/Maturity/Controller/ReferentielController.php | 1 - src/Domain/Maturity/Controller/SurveyController.php | 2 -- src/Domain/Maturity/Repository/Survey.php | 1 - .../Notification/Command/NotificationsSendCommand.php | 1 + src/Domain/Registry/Form/Type/TreatmentType.php | 1 - src/Domain/Reporting/Generator/Csv/TreatmentGenerator.php | 2 +- src/Domain/User/Controller/SecurityController.php | 5 ++--- src/Domain/User/Model/Collectivity.php | 3 --- src/Domain/User/Model/User.php | 6 ------ src/Infrastructure/ORM/Registry/Repository/Treatment.php | 2 -- src/Oauth2Provider/Keycloak/Keycloak.php | 3 +-- 15 files changed, 7 insertions(+), 28 deletions(-) diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 225af856c..2d26992bb 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -1,5 +1,5 @@ parameters: - app.version: "2.3.0" + app.version: "2.3.1" framework: secret: '%env(APP_SECRET)%' diff --git a/src/Application/Traits/Model/CreatorTrait.php b/src/Application/Traits/Model/CreatorTrait.php index a37a4de43..0890fbb40 100644 --- a/src/Application/Traits/Model/CreatorTrait.php +++ b/src/Application/Traits/Model/CreatorTrait.php @@ -30,9 +30,6 @@ trait CreatorTrait { private ?User $creator = null; - /** - * @return User - */ public function getCreator(): ?User { return $this->creator; diff --git a/src/Domain/AIPD/Controller/AnalyseImpactController.php b/src/Domain/AIPD/Controller/AnalyseImpactController.php index fb87dd80c..07ff8e050 100644 --- a/src/Domain/AIPD/Controller/AnalyseImpactController.php +++ b/src/Domain/AIPD/Controller/AnalyseImpactController.php @@ -410,7 +410,7 @@ class AnalyseImpactController extends CRUDController } } } - // dd($object); + return new PdfResponse( $this->pdf->getOutputFromHtml( $this->renderView($this->getTemplatingBasePath('pdf'), [ diff --git a/src/Domain/Maturity/Calculator/Maturity.php b/src/Domain/Maturity/Calculator/Maturity.php index 384e6110b..42472d971 100644 --- a/src/Domain/Maturity/Calculator/Maturity.php +++ b/src/Domain/Maturity/Calculator/Maturity.php @@ -95,7 +95,6 @@ class Maturity $removedMaturities = $maturityList; // Update maturityList with new points // If maturity doesn't exists for related domain, create it - // dd($points); foreach ($points as $key => $point) { if (!isset($maturityList[$key])) { $maturityList[$key] = new Model\Maturity(); diff --git a/src/Domain/Maturity/Controller/ReferentielController.php b/src/Domain/Maturity/Controller/ReferentielController.php index 50e7da183..d34e1b0d3 100644 --- a/src/Domain/Maturity/Controller/ReferentielController.php +++ b/src/Domain/Maturity/Controller/ReferentielController.php @@ -425,7 +425,6 @@ class ReferentielController extends CRUDController /** @var Model\Referentiel $object */ $object = $serializer->deserialize($content, Model\Referentiel::class, 'xml'); $object->deserialize(); - // dd($object); // $object->setDomains($domain); $object->setCreatedAt(new \DateTimeImmutable()); diff --git a/src/Domain/Maturity/Controller/SurveyController.php b/src/Domain/Maturity/Controller/SurveyController.php index ec6678a56..09c183403 100644 --- a/src/Domain/Maturity/Controller/SurveyController.php +++ b/src/Domain/Maturity/Controller/SurveyController.php @@ -293,8 +293,6 @@ class SurveyController extends CRUDController $this->entityManager->persist($object); $this->entityManager->flush(); - // dd($object->getAnswerSurveys()); - $this->addFlash('success', $this->getFlashbagMessage('success', 'edit', $object->__toString())); return $this->redirectToRoute($this->getRouteName('list')); diff --git a/src/Domain/Maturity/Repository/Survey.php b/src/Domain/Maturity/Repository/Survey.php index 9bf3ebeef..2e92bfea3 100644 --- a/src/Domain/Maturity/Repository/Survey.php +++ b/src/Domain/Maturity/Repository/Survey.php @@ -57,7 +57,6 @@ interface Survey extends CRUDRepositoryInterface, DataTablesRepository * * @param array $collectivities The array of collectivity to search with * @param array $order Order the data - * @param int $limit * * @return array The array of survey given by the collectivity */ diff --git a/src/Domain/Notification/Command/NotificationsSendCommand.php b/src/Domain/Notification/Command/NotificationsSendCommand.php index 8ab491891..343dce0c2 100644 --- a/src/Domain/Notification/Command/NotificationsSendCommand.php +++ b/src/Domain/Notification/Command/NotificationsSendCommand.php @@ -213,6 +213,7 @@ class NotificationsSendCommand extends Command return (new \DateTime())->setTime($prefs->getHour(), 0); case EmailNotificationPreference::FREQUENCY_WEEK: $now = new \DateTime(); + // set cutoff date to this week at the specified day and time return (new \DateTime())->setTime($prefs->getHour(), 0)->setISODate($now->format('Y'), $now->format('W'), $prefs->getDay()); case EmailNotificationPreference::FREQUENCY_MONTH: diff --git a/src/Domain/Registry/Form/Type/TreatmentType.php b/src/Domain/Registry/Form/Type/TreatmentType.php index a142df486..c83f55c89 100644 --- a/src/Domain/Registry/Form/Type/TreatmentType.php +++ b/src/Domain/Registry/Form/Type/TreatmentType.php @@ -468,7 +468,6 @@ class TreatmentType extends AbstractType $qb ->orderBy('s.name', 'ASC'); - // dd($qb); return $qb; } diff --git a/src/Domain/Reporting/Generator/Csv/TreatmentGenerator.php b/src/Domain/Reporting/Generator/Csv/TreatmentGenerator.php index a44201daf..52b336286 100644 --- a/src/Domain/Reporting/Generator/Csv/TreatmentGenerator.php +++ b/src/Domain/Reporting/Generator/Csv/TreatmentGenerator.php @@ -116,7 +116,7 @@ class TreatmentGenerator extends AbstractGenerator ); array_push($data, $extract); } - // dd($data); + return $data; } diff --git a/src/Domain/User/Controller/SecurityController.php b/src/Domain/User/Controller/SecurityController.php index 14ef60e60..bce0bf32e 100644 --- a/src/Domain/User/Controller/SecurityController.php +++ b/src/Domain/User/Controller/SecurityController.php @@ -32,7 +32,6 @@ use App\Domain\User\Form\Type\ResetPasswordType; use App\Domain\User\Model\User; use App\Domain\User\Repository; use Doctrine\ORM\EntityManagerInterface; -use Exception; use KnpU\OAuth2ClientBundle\Client\ClientRegistry; use KnpU\OAuth2ClientBundle\Client\OAuth2Client; use League\OAuth2\Client\Provider\Exception\IdentityProviderException; @@ -113,7 +112,7 @@ class SecurityController extends AbstractController $oauthServiceName = $request->get('service'); try { $client = $clientRegistry->getClient($oauthServiceName); - } catch (Exception) { + } catch (\Exception) { return $this->_handleSsoClientError(); } @@ -138,7 +137,7 @@ class SecurityController extends AbstractController $sso_key_field = $this->sso_key_field; try { $sso_value = $userOAuthData[$sso_key_field]; - } catch (Exception) { + } catch (\Exception) { $logger->error('SSO field "' . $sso_key_field . '" not found.'); $logger->info('Data returned by SSO: ' . json_encode($userOAuthData)); diff --git a/src/Domain/User/Model/Collectivity.php b/src/Domain/User/Model/Collectivity.php index f440f18d3..72967771d 100644 --- a/src/Domain/User/Model/Collectivity.php +++ b/src/Domain/User/Model/Collectivity.php @@ -502,9 +502,6 @@ class Collectivity implements LoggableSubject $modeleAnalyse->addAuthorizedCollectivity($this); } - /** - * @return bool - */ public function isHasModuleConformiteTraitement(): ?bool { return $this->hasModuleConformiteTraitement; diff --git a/src/Domain/User/Model/User.php b/src/Domain/User/Model/User.php index 5347dbeae..a69e57055 100644 --- a/src/Domain/User/Model/User.php +++ b/src/Domain/User/Model/User.php @@ -426,17 +426,11 @@ class User implements LoggableSubject, UserInterface, CollectivityRelated, Passw $this->ssoKey = $ssoKey; } - /** - * @return bool - */ public function isNotGeneratesNotifications(): ?bool { return $this->notGeneratesNotifications; } - /** - * @param bool $notGeneratesNotifications - */ public function setNotGeneratesNotifications(?bool $notGeneratesNotifications): void { $this->notGeneratesNotifications = $notGeneratesNotifications; diff --git a/src/Infrastructure/ORM/Registry/Repository/Treatment.php b/src/Infrastructure/ORM/Registry/Repository/Treatment.php index e65e4109a..3e21afd5f 100644 --- a/src/Infrastructure/ORM/Registry/Repository/Treatment.php +++ b/src/Infrastructure/ORM/Registry/Repository/Treatment.php @@ -444,8 +444,6 @@ class Treatment extends CRUDRepository implements Repository\Treatment ->setParameter('sensitiveDatas', 1) ->groupBy('o.id') ; - - // dd($queryBuilder->getQuery()->getSQL()); } break; diff --git a/src/Oauth2Provider/Keycloak/Keycloak.php b/src/Oauth2Provider/Keycloak/Keycloak.php index 327fe3093..e5dbe62e3 100644 --- a/src/Oauth2Provider/Keycloak/Keycloak.php +++ b/src/Oauth2Provider/Keycloak/Keycloak.php @@ -3,7 +3,6 @@ namespace App\Oauth2Provider\Keycloak; use App\Oauth2Provider\Keycloak\Exception\EncryptionConfigurationException; -use Exception; use Firebase\JWT\JWT; use Firebase\JWT\Key; use League\OAuth2\Client\Provider\AbstractProvider; @@ -262,7 +261,7 @@ class Keycloak extends AbstractProvider { try { $this->encryptionKey = file_get_contents($encryptionKeyPath); - } catch (Exception) { + } catch (\Exception) { // Not sure how to handle this yet. } -- GitLab