Vincent vor 2 Jahren
Ursprung
Commit
d17caf044d

+ 2 - 4
config/packages/api_platform.yaml

@@ -10,9 +10,7 @@ api_platform:
         json: ['application/merge-patch+json']
     swagger:
         versions: [3]
-    collection:
-        pagination:
-            # The default number of items per page.
-            items_per_page: 20
     resource_class_directories:
         - '%kernel.project_dir%/src/Entity'
+    defaults:
+        pagination_items_per_page: 20

+ 1 - 0
config/packages/framework.yaml

@@ -7,6 +7,7 @@ framework:
     # Enables session support. Note that the session will ONLY be started if you read or write from it.
     # Remove or comment this section to explicitly disable session support.
     session:
+        storage_factory_id: session.storage.factory.native
         handler_id: null
         cookie_secure: auto
         cookie_samesite: lax

+ 2 - 0
config/packages/messenger.yaml

@@ -3,6 +3,8 @@ framework:
         # Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
         failure_transport: failed
 
+        reset_on_message: true
+
         transports:
             # https://symfony.com/doc/current/messenger.html#transport-configuration
             async: '%env(MESSENGER_TRANSPORT_DSN)%'

+ 2 - 2
config/packages/security.yaml

@@ -119,9 +119,9 @@ security:
             - ROLE_CORE
             - ROLE_RULERZ_ACTION
 
-    encoders:
+    password_hashers:
         App\Entity\Person\Person:
-            algorithm: plaintext
+            algorithm: bcrypt
 
     # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
     providers:

+ 1 - 1
config/packages/test/framework.yaml

@@ -1,4 +1,4 @@
 framework:
     test: true
     session:
-        storage_id: session.storage.mock_file
+        storage_factory_id: session.storage.mock_file

+ 6 - 0
config/services.yaml

@@ -104,3 +104,9 @@ services:
     App\Service\Elasticsearch\EducationNotationUpdater:
         arguments:
             - '@fos_elastica.object_persister.search.educationNotation'
+
+    #########################################
+    ## AutoWiring du service container ##
+    Symfony\Component\DependencyInjection\ContainerInterface: '@service_container'
+    #########################################
+

+ 1 - 1
src/Commands/Doctrine/SchemaUpdateCommand.php

@@ -14,7 +14,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
  */
 class SchemaUpdateCommand extends UpdateSchemaDoctrineCommand
 {
-    protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas, SymfonyStyle $ui)
+    protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas, SymfonyStyle $ui): ?int
     {
         $output->writeln('-- Executing pre-update scripts');
 

+ 4 - 5
src/Entity/Access/Access.php

@@ -56,19 +56,21 @@ use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use JetBrains\PhpStorm\Pure;
+use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
 use Symfony\Component\Security\Core\User\UserInterface;
 use Symfony\Component\Serializer\Annotation\Groups;
 
 /**
  * Fais le lien entre une Person et une Organization
- * @ApiResource @see : config/api_platform/Access/access.yaml
+ * @see : config/api_platform/Access/access.yaml
  */
+#[ApiResource]
 #[Auditable]
 #[ORM\Entity(repositoryClass: AccessRepository::class)]
 #[ApiFilter(BooleanFilter::class, properties: ['person.isPhysical'])]
 #[ApiFilter(FullNameFilter::class)]
 #[ApiFilter(InFilter::class, properties: ['id'])]
-class Access implements UserInterface
+class Access implements UserInterface, PasswordAuthenticatedUserInterface
 {
     #[ORM\Id]
     #[ORM\Column]
@@ -282,9 +284,6 @@ class Access implements UserInterface
     #[ORM\OneToMany(mappedBy: 'student', targetEntity: WorkByUser::class, cascade: ['persist'], orphanRemoval: true)]
     private Collection $workByUsers;
 
-    #[ORM\OneToMany(mappedBy: 'access', targetEntity: Email::class, cascade: ['persist'], orphanRemoval: true)]
-    private Collection $report;
-
     #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'accesses', cascade: ['persist'])]
     #[ORM\JoinTable(name: 'tag_access')]
     #[ORM\JoinColumn(name: 'access_id', referencedColumnName: 'id')]

+ 2 - 1
src/Entity/Person/Person.php

@@ -16,6 +16,7 @@ use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\Common\Collections\Collection;
 use Doctrine\ORM\Mapping as ORM;
 use JetBrains\PhpStorm\Pure;
+use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
 use Symfony\Component\Security\Core\User\UserInterface;
 use Symfony\Component\Validator\Constraints as Assert;
 use Symfony\Component\Serializer\Annotation\Groups;
@@ -31,7 +32,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
     ]
 )]
 #[ORM\Entity(repositoryClass: PersonRepository::class)]
-class Person implements UserInterface
+class Person implements UserInterface, PasswordAuthenticatedUserInterface
 {
     #[ORM\Id]
     #[ORM\Column]

+ 1 - 1
src/EventSubscriber/ElasticaPostTransformSubscriber.php

@@ -25,7 +25,7 @@ final class ElasticaPostTransformSubscriber implements EventSubscriberInterface
     /**
      * ne se déclenche qu'après le post validate d'api platform
      */
-    public static function getSubscribedEvents()
+    public static function getSubscribedEvents(): array
     {
         return [
             PreTransformEvent::class => 'doPostTransform',