diff --git a/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php b/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php index 7dd20367e..d5ddf329d 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php @@ -93,7 +93,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController { return match ($action) { 'ps_situation_edit' => $this->redirectToRoute( - 'chill_crud_' .$this->getCrudName().'_personal_situation_view', + 'chill_crud_'.$this->getCrudName().'_personal_situation_view', ['person' => $entity->getId()] ), 'dispositifs_edit' => $this->redirectToRoute( diff --git a/src/Bundle/ChillJobBundle/src/Controller/CVCrudController.php b/src/Bundle/ChillJobBundle/src/Controller/CVCrudController.php index 473aff62e..bd78498cb 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/CVCrudController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/CVCrudController.php @@ -14,7 +14,6 @@ namespace Chill\JobBundle\Controller; use Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; -use Chill\JobBundle\Entity\Immersion; use Symfony\Component\HttpFoundation\Response; /** diff --git a/src/Bundle/ChillJobBundle/src/Controller/FreinCrudController.php b/src/Bundle/ChillJobBundle/src/Controller/FreinCrudController.php index 71aadfa5c..d3b8ee6ef 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/FreinCrudController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/FreinCrudController.php @@ -14,7 +14,6 @@ namespace Chill\JobBundle\Controller; use Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; -use Chill\JobBundle\Entity\Immersion; use Symfony\Component\HttpFoundation\Response; /** diff --git a/src/Bundle/ChillJobBundle/src/Controller/ProjetProfessionnelCrudController.php b/src/Bundle/ChillJobBundle/src/Controller/ProjetProfessionnelCrudController.php index 55cab01eb..80c953699 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/ProjetProfessionnelCrudController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/ProjetProfessionnelCrudController.php @@ -14,7 +14,6 @@ namespace Chill\JobBundle\Controller; use Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; -use Chill\JobBundle\Entity\Immersion; use Symfony\Component\HttpFoundation\Response; /** diff --git a/src/Bundle/ChillJobBundle/src/DependencyInjection/ChillJobExtension.php b/src/Bundle/ChillJobBundle/src/DependencyInjection/ChillJobExtension.php index 42165715a..165b5e557 100644 --- a/src/Bundle/ChillJobBundle/src/DependencyInjection/ChillJobExtension.php +++ b/src/Bundle/ChillJobBundle/src/DependencyInjection/ChillJobExtension.php @@ -11,7 +11,6 @@ declare(strict_types=1); namespace Chill\JobBundle\DependencyInjection; -use Chill\JobBundle\Controller\CSCrudReportController; use Chill\JobBundle\Controller\CSPersonController; use Chill\JobBundle\Controller\CVCrudController; use Chill\JobBundle\Controller\FreinCrudController; @@ -97,7 +96,7 @@ class ChillJobExtension extends Extension implements PrependExtensionInterface 'delete' => [ 'role' => 'ROLE_USER', 'template' => '@ChillJob/Report/delete.html.twig', - ] + ], ], ], [ @@ -122,8 +121,8 @@ class ChillJobExtension extends Extension implements PrependExtensionInterface ], 'delete' => [ 'role' => 'ROLE_USER', - 'template' => '@ChillJob/Report/delete.html.twig' - ] + 'template' => '@ChillJob/Report/delete.html.twig', + ], ], ], [ @@ -149,7 +148,7 @@ class ChillJobExtension extends Extension implements PrependExtensionInterface 'delete' => [ 'role' => 'ROLE_USER', 'template' => '@ChillJob/Report/delete.html.twig', - ] + ], ], ], [ @@ -179,7 +178,7 @@ class ChillJobExtension extends Extension implements PrependExtensionInterface 'delete' => [ 'role' => 'ROLE_USER', 'template' => '@ChillJob/Report/delete.html.twig', - ] + ], ], ], ], diff --git a/src/Bundle/ChillJobBundle/src/Entity/CV.php b/src/Bundle/ChillJobBundle/src/Entity/CV.php index 597303510..257e4a0d0 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/CV.php +++ b/src/Bundle/ChillJobBundle/src/Entity/CV.php @@ -76,7 +76,7 @@ class CV implements \Stringable * @var \Doctrine\Common\Collections\Collection */ #[ORM\OneToMany(targetEntity: CV\Formation::class, mappedBy: 'CV', cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)] -// #[ORM\OrderBy(['startDate' => Order::Descending, 'endDate' => 'DESC'])] + // #[ORM\OrderBy(['startDate' => Order::Descending, 'endDate' => 'DESC'])] private Collection $formations; /** @@ -85,7 +85,7 @@ class CV implements \Stringable * @var \Doctrine\Common\Collections\Collection */ #[ORM\OneToMany(targetEntity: CV\Experience::class, mappedBy: 'CV', cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)] -// #[ORM\OrderBy(['startDate' => Order::Descending, 'endDate' => 'DESC'])] + // #[ORM\OrderBy(['startDate' => Order::Descending, 'endDate' => 'DESC'])] private Collection $experiences; #[ORM\ManyToOne(targetEntity: Person::class)] diff --git a/src/Bundle/ChillJobBundle/src/Entity/Immersion.php b/src/Bundle/ChillJobBundle/src/Entity/Immersion.php index 478615d83..174375432 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/Immersion.php +++ b/src/Bundle/ChillJobBundle/src/Entity/Immersion.php @@ -43,7 +43,7 @@ class Immersion implements \Stringable * @Assert\NotNull() */ #[ORM\ManyToOne(targetEntity: Person::class)] - private $person; + private ?\Chill\PersonBundle\Entity\Person $person = null; /** * @Assert\NotNull() @@ -125,7 +125,7 @@ class Immersion implements \Stringable * @Assert\NotNull() */ #[ORM\Column(name: 'debutDate', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)] - private ?\DateTimeInterface $debutDate = null; + private ?\DateTime $debutDate = null; /** * @var string|null @@ -488,11 +488,9 @@ class Immersion implements \Stringable /** * Set debutDate. * - * @param \DateTime|null $debutDate - * * @return Immersion */ - public function setDebutDate(?\DateTimeInterface $debutDate = null) + public function setDebutDate(?\DateTime $debutDate = null) { $this->debutDate = $debutDate; @@ -502,7 +500,7 @@ class Immersion implements \Stringable /** * Get debutDate. * - * @return \DateTimeInterface + * @return \DateTime */ public function getDebutDate() { @@ -526,11 +524,11 @@ class Immersion implements \Stringable /** * Get duration. * - * @return string|null + * @return \DateInterval */ public function getDuration() { - return $this->duration; + return new \DateInterval($this->duration); } public function getDateEndComputed() diff --git a/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php b/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php index 40141b9e3..44dd6b412 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php +++ b/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php @@ -36,7 +36,7 @@ class ProjetProfessionnel implements \Stringable * @Assert\NotNull() */ #[ORM\ManyToOne(targetEntity: Person::class)] - private $person; + private ?\Chill\PersonBundle\Entity\Person $person = null; /** * @Assert\NotNull() diff --git a/src/Bundle/ChillJobBundle/src/Menu/MenuBuilder.php b/src/Bundle/ChillJobBundle/src/Menu/MenuBuilder.php index e3119a392..c838a4b1a 100644 --- a/src/Bundle/ChillJobBundle/src/Menu/MenuBuilder.php +++ b/src/Bundle/ChillJobBundle/src/Menu/MenuBuilder.php @@ -60,9 +60,9 @@ class MenuBuilder implements LocalMenuBuilderInterface 'person' => $person->getId(), ], ]) - ->setExtras([ - 'order' => 52, - ]); + ->setExtras([ + 'order' => 52, + ]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillJobBundle/src/Security/Authorization/JobVoter.php b/src/Bundle/ChillJobBundle/src/Security/Authorization/JobVoter.php index 40952cdff..54de180f5 100644 --- a/src/Bundle/ChillJobBundle/src/Security/Authorization/JobVoter.php +++ b/src/Bundle/ChillJobBundle/src/Security/Authorization/JobVoter.php @@ -15,7 +15,6 @@ use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Chill\JobBundle\Entity\Frein; use Chill\JobBundle\Entity\CV; -use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; use Chill\JobBundle\Entity\Immersion; use Chill\JobBundle\Entity\ProjetProfessionnel; use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; diff --git a/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php b/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php index 1e4fcf7cb..87c9d3623 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php +++ b/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php @@ -2,6 +2,13 @@ declare(strict_types=1); +/* + * Chill is a software for social workers + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace Chill\Migrations\Job; use Doctrine\DBAL\Schema\Schema; diff --git a/src/Bundle/ChillJobBundle/src/migrations/Version20240429111628.php b/src/Bundle/ChillJobBundle/src/migrations/Version20240429111628.php index 1a3d4d043..e12318d7c 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/Version20240429111628.php +++ b/src/Bundle/ChillJobBundle/src/migrations/Version20240429111628.php @@ -2,6 +2,13 @@ declare(strict_types=1); +/* + * Chill is a software for social workers + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace Chill\Migrations\Job; use Doctrine\DBAL\Schema\Schema;