mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-30 06:39:40 +02:00
Applied rector rules up to symfony 6.2
This commit is contained in:
parent
88ea920dfb
commit
a43af180a7
145 changed files with 563 additions and 889 deletions
|
@ -35,31 +35,31 @@ trait AdvancedPropertyTrait
|
|||
/**
|
||||
* @var bool Determines if this part entry needs review (for example, because it is work in progress)
|
||||
* @ORM\Column(type="boolean")
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected bool $needs_review = false;
|
||||
|
||||
/**
|
||||
* @var string a comma separated list of tags, associated with the part
|
||||
* @ORM\Column(type="text")
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected string $tags = '';
|
||||
|
||||
/**
|
||||
* @var float|null how much a single part unit weighs in grams
|
||||
* @ORM\Column(type="float", nullable=true)
|
||||
* @Assert\PositiveOrZero()
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Assert\PositiveOrZero]
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected ?float $mass = null;
|
||||
|
||||
/**
|
||||
* @var string|null The internal part number of the part
|
||||
* @ORM\Column(type="string", length=100, nullable=true, unique=true)
|
||||
* @Assert\Length(max="100")
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Assert\Length(max: 100)]
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected ?string $ipn = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,15 +34,15 @@ trait BasicPropertyTrait
|
|||
/**
|
||||
* @var string A text describing what this part does
|
||||
* @ORM\Column(type="text")
|
||||
* @Groups({"simple", "extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['simple', 'extended', 'full', 'import'])]
|
||||
protected string $description = '';
|
||||
|
||||
/**
|
||||
* @var string A comment/note related to this part
|
||||
* @ORM\Column(type="text")
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected string $comment = '';
|
||||
|
||||
/**
|
||||
|
@ -54,8 +54,8 @@ trait BasicPropertyTrait
|
|||
/**
|
||||
* @var bool true, if the part is marked as favorite
|
||||
* @ORM\Column(type="boolean")
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected bool $favorite = false;
|
||||
|
||||
/**
|
||||
|
@ -64,9 +64,9 @@ trait BasicPropertyTrait
|
|||
* @ORM\ManyToOne(targetEntity="Category")
|
||||
* @ORM\JoinColumn(name="id_category", referencedColumnName="id", nullable=false)
|
||||
* @Selectable()
|
||||
* @Assert\NotNull(message="validator.select_valid_category")
|
||||
* @Groups({"simple", "extended", "full", "import"})
|
||||
*/
|
||||
#[Assert\NotNull(message: 'validator.select_valid_category')]
|
||||
#[Groups(['simple', 'extended', 'full', 'import'])]
|
||||
protected ?Category $category = null;
|
||||
|
||||
/**
|
||||
|
@ -74,8 +74,8 @@ trait BasicPropertyTrait
|
|||
* @ORM\ManyToOne(targetEntity="Footprint")
|
||||
* @ORM\JoinColumn(name="id_footprint", referencedColumnName="id")
|
||||
* @Selectable()
|
||||
* @Groups({"simple", "extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['simple', 'extended', 'full', 'import'])]
|
||||
protected ?Footprint $footprint = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,27 +37,27 @@ trait InstockTrait
|
|||
/**
|
||||
* @var Collection|PartLot[] A list of part lots where this part is stored
|
||||
* @ORM\OneToMany(targetEntity="PartLot", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
* @Assert\Valid()
|
||||
* @ORM\OrderBy({"amount" = "DESC"})
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Assert\Valid]
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected $partLots;
|
||||
|
||||
/**
|
||||
* @var float The minimum amount of the part that has to be instock, otherwise more is ordered.
|
||||
* Given in the partUnit.
|
||||
* @ORM\Column(type="float")
|
||||
* @Assert\PositiveOrZero()
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Assert\PositiveOrZero]
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected float $minamount = 0;
|
||||
|
||||
/**
|
||||
* @var ?MeasurementUnit the unit in which the part's amount is measured
|
||||
* @ORM\ManyToOne(targetEntity="MeasurementUnit")
|
||||
* @ORM\JoinColumn(name="id_part_unit", referencedColumnName="id", nullable=true)
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected ?MeasurementUnit $partUnit = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,31 +39,31 @@ trait ManufacturerTrait
|
|||
* @ORM\ManyToOne(targetEntity="Manufacturer")
|
||||
* @ORM\JoinColumn(name="id_manufacturer", referencedColumnName="id")
|
||||
* @Selectable()
|
||||
* @Groups({"simple","extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['simple', 'extended', 'full', 'import'])]
|
||||
protected ?Manufacturer $manufacturer = null;
|
||||
|
||||
/**
|
||||
* @var string the url to the part on the manufacturer's homepage
|
||||
* @ORM\Column(type="string")
|
||||
* @Assert\Url()
|
||||
* @Groups({"full", "import"})
|
||||
*/
|
||||
#[Assert\Url]
|
||||
#[Groups(['full', 'import'])]
|
||||
protected string $manufacturer_product_url = '';
|
||||
|
||||
/**
|
||||
* @var string The product number used by the manufacturer. If this is set to "", the name field is used.
|
||||
* @ORM\Column(type="string")
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected string $manufacturer_product_number = '';
|
||||
|
||||
/**
|
||||
* @var string|null The production status of this part. Can be one of the specified ones.
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @Assert\Choice({"announced", "active", "nrfnd", "eol", "discontinued", ""})
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Assert\Choice(['announced', 'active', 'nrfnd', 'eol', 'discontinued', ''])]
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected ?string $manufacturing_status = '';
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,10 +37,10 @@ trait OrderTrait
|
|||
/**
|
||||
* @var Orderdetail[]|Collection the details about how and where you can order this part
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Orderdetail", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
* @Assert\Valid()
|
||||
* @ORM\OrderBy({"supplierpartnr" = "ASC"})
|
||||
* @Groups({"extended", "full", "import"})
|
||||
*/
|
||||
#[Assert\Valid]
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
protected $orderdetails;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue