Applied rector rules up to symfony 6.2

This commit is contained in:
Jan Böhmer 2023-05-28 01:21:05 +02:00
parent 88ea920dfb
commit a43af180a7
145 changed files with 563 additions and 889 deletions

View file

@ -99,9 +99,9 @@ abstract class Attachment extends AbstractNamedDBElement
/**
* @var string the name of this element
* @ORM\Column(type="string")
* @Assert\NotBlank(message="validator.attachment.name_not_blank")
* @Groups({"simple", "extended", "full"})
*/
#[Assert\NotBlank(message: 'validator.attachment.name_not_blank')]
#[Groups(['simple', 'extended', 'full'])]
protected string $name = '';
/**
@ -120,8 +120,8 @@ abstract class Attachment extends AbstractNamedDBElement
* @ORM\ManyToOne(targetEntity="AttachmentType", inversedBy="attachments_with_type")
* @ORM\JoinColumn(name="type_id", referencedColumnName="id", nullable=false)
* @Selectable()
* @Assert\NotNull(message="validator.attachment.must_not_be_null")
*/
#[Assert\NotNull(message: 'validator.attachment.must_not_be_null')]
protected ?AttachmentType $attachment_type = null;
public function __construct()

View file

@ -44,8 +44,8 @@ abstract class AttachmentContainingDBElement extends AbstractNamedDBElement impl
* //@ORM\OneToMany(targetEntity="Attachment", mappedBy="element")
*
* Mapping is done in sub classes like part
* @Groups({"full"})
*/
#[Groups(['full'])]
protected Collection $attachments;
public function __construct()

View file

@ -63,15 +63,15 @@ class AttachmentType extends AbstractStructuralDBElement
* @var Collection<int, AttachmentTypeAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"name" = "ASC"})
* @Assert\Valid()
*/
#[Assert\Valid]
protected Collection $attachments;
/** @var Collection<int, AttachmentTypeParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\AttachmentTypeParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid()
*/
#[Assert\Valid]
protected Collection $parameters;
/**

View file

@ -29,8 +29,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* A attachment attached to an attachmentType element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class AttachmentTypeAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = AttachmentType::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a category element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class CategoryAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Category::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a currency element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class CurrencyAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Currency::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a footprint element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class FootprintAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Footprint::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a Group element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class GroupAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Group::class;

View file

@ -49,8 +49,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* A attachment attached to a user element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class LabelAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = LabelProfile::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a manufacturer element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class ManufacturerAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Manufacturer::class;

View file

@ -31,8 +31,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a measurement unit element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class MeasurementUnitAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = MeasurementUnit::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* A attachment attached to a part element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class PartAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Part::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* A attachment attached to a device element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class ProjectAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Project::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a measurement unit element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class StorelocationAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Storelocation::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* A attachment attached to a supplier element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class SupplierAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = Supplier::class;

View file

@ -30,8 +30,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a user element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})
*/
#[UniqueEntity(['name', 'attachment_type', 'element'])]
class UserAttachment extends Attachment
{
public const ALLOWED_ELEMENT_CLASS = User::class;