misc phpstan issues

This commit is contained in:
2025-12-22 15:28:54 +01:00
parent c94cb741c6
commit 22c3952c00
3 changed files with 18 additions and 18 deletions

View File

@@ -50,7 +50,7 @@ final class ThirdPartyController extends CRUDController
return $defaultTemplateParameters;
}
protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper
protected function buildFilterOrderHelper(string $action, Request $request): FilterOrderHelper
{
return $this->filterOrderHelperFactory
->create(self::class)

View File

@@ -21,6 +21,7 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use libphonenumber\PhoneNumber;
use Symfony\Component\Serializer\Attribute\Context;
@@ -86,13 +87,13 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* [fr] Sigle.
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'acronym', type: \Doctrine\DBAL\Types\Types::STRING, length: 64, nullable: true)]
#[ORM\Column(name: 'acronym', type: Types::STRING, length: 64, nullable: true)]
private ?string $acronym = '';
/**
* Soft-delete flag.
*/
#[ORM\Column(name: 'active', type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['defaut' => true])]
#[ORM\Column(name: 'active', type: Types::BOOLEAN, options: ['defaut' => true])]
private bool $active = true;
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
@@ -106,7 +107,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
*
* This field is read-only, and is generated on database side.
*/
#[ORM\Column(name: 'canonicalized', type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''])]
#[ORM\Column(name: 'canonicalized', type: Types::TEXT, nullable: false, options: ['default' => ''])]
private ?string $canonicalized = '';
/**
@@ -140,14 +141,14 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
private ?Civility $civility = null;
#[Groups(['read', 'write'])]
#[ORM\Column(name: 'comment', type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
#[ORM\Column(name: 'comment', type: Types::TEXT, nullable: true)]
private ?string $comment = null;
#[Groups(['read', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'contact_data_anonymous', type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
#[ORM\Column(name: 'contact_data_anonymous', type: Types::BOOLEAN, options: ['default' => false])]
private bool $contactDataAnonymous = false;
#[ORM\Column(name: 'created_at', type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)]
#[ORM\Column(name: 'created_at', type: Types::DATETIME_IMMUTABLE, nullable: false)]
private \DateTimeImmutable $createdAt;
#[ORM\ManyToOne(targetEntity: User::class)]
@@ -156,35 +157,35 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
#[Assert\Email]
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'email', type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
#[ORM\Column(name: 'email', type: Types::STRING, length: 255, nullable: true)]
private ?string $email = null;
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'firstname', type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''])]
#[ORM\Column(name: 'firstname', type: Types::TEXT, nullable: false, options: ['default' => ''])]
private ?string $firstname = '';
#[Groups(['read', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\Column(name: 'id', type: Types::INTEGER)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
#[Groups(['write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'kind', type: \Doctrine\DBAL\Types\Types::STRING, length: 20, options: ['default' => ''])]
#[ORM\Column(name: 'kind', type: Types::STRING, length: 20, options: ['default' => ''])]
private string $kind = '';
#[Assert\Length(min: 2)]
#[Assert\NotNull]
#[Assert\NotBlank]
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'name', type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
#[ORM\Column(name: 'name', type: Types::STRING, length: 255)]
private string $name = '';
/**
* [fr] Raison sociale.
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'name_company', type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
#[ORM\Column(name: 'name_company', type: Types::STRING, length: 255, nullable: true)]
private ?string $nameCompany = '';
/**
@@ -200,7 +201,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* [fr] Qualité.
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'profession', type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
#[ORM\Column(name: 'profession', type: Types::TEXT, nullable: false, options: ['default' => ''])]
#[Context(normalizationContext: ['groups' => 'docgen:read'], groups: ['docgen:read:3party:parent'])]
private string $profession = '';
@@ -214,10 +215,10 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
#[PhonenumberConstraint(type: 'any')]
private ?PhoneNumber $telephone2 = null;
#[ORM\Column(name: 'types', type: \Doctrine\DBAL\Types\Types::JSON, nullable: true)]
#[ORM\Column(name: 'types', type: Types::JSON, nullable: true)]
private ?array $thirdPartyTypes = [];
#[ORM\Column(name: 'updated_at', type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
#[ORM\Column(name: 'updated_at', type: Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $updatedAt = null;
#[ORM\ManyToOne(targetEntity: User::class)]

View File

@@ -114,9 +114,8 @@ class ThirdPartyRepository implements ObjectRepository
/**
* @param null $limit
* @param null $offset
*
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}