Applied rector with PHP8.1 migration rules

This commit is contained in:
Jan Böhmer 2023-06-11 14:15:46 +02:00
parent dc6a67c2f0
commit 7ee01d9a05
303 changed files with 1228 additions and 3465 deletions

View file

@ -142,7 +142,6 @@ trait AdvancedPropertyTrait
/**
* Sets the internal part number of the part
* @param string $ipn The new IPN of the part
* @return Part
*/
public function setIpn(?string $ipn): Part
{

View file

@ -153,7 +153,6 @@ trait InstockTrait
/**
* Returns true, if the total instock amount of this part is less than the minimum amount.
* @return bool
*/
public function isNotEnoughInstock(): bool
{
@ -204,7 +203,6 @@ trait InstockTrait
/**
* Returns the summed amount of all part lots that are expired. If no part lots are expired 0 is returned.
* @return float
*/
public function getExpiredAmountSum(): float
{

View file

@ -39,7 +39,7 @@ trait OrderTrait
*/
#[Assert\Valid]
#[Groups(['extended', 'full', 'import'])]
#[ORM\OneToMany(targetEntity: 'App\Entity\PriceInformations\Orderdetail', mappedBy: 'part', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: \App\Entity\PriceInformations\Orderdetail::class, mappedBy: 'part', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['supplierpartnr' => 'ASC'])]
protected \Doctrine\Common\Collections\Collection $orderdetails;
@ -58,7 +58,7 @@ trait OrderTrait
/**
* @var Orderdetail|null
*/
#[ORM\OneToOne(targetEntity: 'App\Entity\PriceInformations\Orderdetail')]
#[ORM\OneToOne(targetEntity: \App\Entity\PriceInformations\Orderdetail::class)]
#[ORM\JoinColumn(name: 'order_orderdetails_id')]
protected ?Orderdetail $order_orderdetail = null;
@ -105,9 +105,7 @@ trait OrderTrait
{
//If needed hide the obsolete entries
if ($hide_obsolete) {
return $this->orderdetails->filter(function (Orderdetail $orderdetail) {
return ! $orderdetail->getObsolete();
});
return $this->orderdetails->filter(fn(Orderdetail $orderdetail) => ! $orderdetail->getObsolete());
}
return $this->orderdetails;

View file

@ -13,13 +13,13 @@ trait ProjectTrait
/**
* @var \Doctrine\Common\Collections\Collection<\App\Entity\ProjectSystem\ProjectBOMEntry> $project_bom_entries
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\ProjectSystem\ProjectBOMEntry', mappedBy: 'part', cascade: ['remove'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: \App\Entity\ProjectSystem\ProjectBOMEntry::class, mappedBy: 'part', cascade: ['remove'], orphanRemoval: true)]
protected \Doctrine\Common\Collections\Collection $project_bom_entries;
/**
* @var Project|null If a project is set here, then this part is special and represents the builds of a project.
*/
#[ORM\OneToOne(targetEntity: 'App\Entity\ProjectSystem\Project', inversedBy: 'build_part')]
#[ORM\OneToOne(targetEntity: \App\Entity\ProjectSystem\Project::class, inversedBy: 'build_part')]
#[ORM\JoinColumn]
protected ?Project $built_project = null;
@ -43,7 +43,6 @@ trait ProjectTrait
/**
* Returns the project that this part represents the builds of, or null if it doesn't
* @return Project|null
*/
public function getBuiltProject(): ?Project
{