mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
fix phpstan and rector errors, fix path for rector rules
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Chill\CustomFieldsBundle\Controller;
|
||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||
use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup;
|
||||
use Chill\CustomFieldsBundle\Form\CustomFieldType;
|
||||
use Symfony\Bridge\Doctrine\ManagerRegistry;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
@@ -39,8 +39,6 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
*/
|
||||
protected array $crudConfig = [];
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry) {}
|
||||
|
||||
/**
|
||||
* get the role given from the config.
|
||||
*/
|
||||
@@ -183,7 +181,7 @@ abstract class AbstractCRUDController extends AbstractController
|
||||
$expectedVersion = $request->query->getInt('entity_version');
|
||||
|
||||
try {
|
||||
$manager = $this->managerRegistry->getManagerForClass($this->getEntityClass());
|
||||
$manager = $this->getManagerRegistry()->getManagerForClass($this->getEntityClass());
|
||||
|
||||
if ($manager instanceof EntityManagerInterface) {
|
||||
$manager->lock($e, LockMode::OPTIMISTIC, $expectedVersion);
|
||||
|
@@ -102,7 +102,7 @@ class SortExportElementTest extends KernelTestCase
|
||||
private function makeTranslator(): TranslatorInterface
|
||||
{
|
||||
return new class () implements TranslatorInterface {
|
||||
public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null)
|
||||
public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null)
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
|
@@ -16,8 +16,8 @@ use Chill\PersonBundle\Form\AccompanyingCourseCommentType;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodCommentVoter;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Bridge\Doctrine\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
|
@@ -503,7 +503,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* The person's spoken languages.
|
||||
*
|
||||
* @var Collection<Language>
|
||||
* @var Collection<int, Language>
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\Language")
|
||||
*
|
||||
@@ -1788,9 +1788,9 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
}
|
||||
|
||||
/**
|
||||
* @param (\Doctrine\Common\Collections\Collection&\iterable<\Chill\MainBundle\Entity\Language>) $spokenLanguages
|
||||
* @param (\Doctrine\Common\Collections\Collection<int, Language>) $spokenLanguages
|
||||
*/
|
||||
public function setSpokenLanguages(mixed $spokenLanguages): self
|
||||
public function setSpokenLanguages(Collection $spokenLanguages): self
|
||||
{
|
||||
$this->spokenLanguages = $spokenLanguages;
|
||||
|
||||
|
@@ -27,7 +27,7 @@ class ByStepAggregatorTest extends AbstractAggregatorTest
|
||||
public function getAggregator()
|
||||
{
|
||||
$translator = new class () implements TranslatorInterface {
|
||||
public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null)
|
||||
public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null)
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ class ByStepFilterTest extends AbstractFilterTest
|
||||
public function getFilter()
|
||||
{
|
||||
$translator = new class () implements TranslatorInterface {
|
||||
public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null)
|
||||
public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null)
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
|
Reference in New Issue
Block a user