mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-14 20:35:08 +02:00
Started to increase the phpstan level
This commit is contained in:
parent
71cd4057a7
commit
fc3290271c
29 changed files with 119 additions and 55 deletions
|
@ -35,7 +35,9 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
|||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Class AttachmentType.
|
||||
* This entity describes a category, a part can belong to, which is used to group parts by their function.
|
||||
*
|
||||
* @extends AbstractPartsContainingDBElement<CategoryAttachment, CategoryParameter>
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: CategoryRepository::class)]
|
||||
#[ORM\Table(name: '`categories`')]
|
||||
|
@ -43,9 +45,6 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
#[ORM\Index(name: 'category_idx_parent_name', columns: ['parent_id', 'name'])]
|
||||
class Category extends AbstractPartsContainingDBElement
|
||||
{
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: 'Category', mappedBy: 'parent')]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $children;
|
||||
|
|
|
@ -33,7 +33,9 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Class Footprint.
|
||||
* This entity represents a footprint of a part (its physical dimensions and shape).
|
||||
*
|
||||
* @extends AbstractPartsContainingDBElement<FootprintAttachment, FootprintParameter>
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: FootprintRepository::class)]
|
||||
#[ORM\Table('`footprints`')]
|
||||
|
@ -45,9 +47,6 @@ class Footprint extends AbstractPartsContainingDBElement
|
|||
#[ORM\JoinColumn(name: 'parent_id')]
|
||||
protected ?AbstractStructuralDBElement $parent = null;
|
||||
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: 'Footprint', mappedBy: 'parent')]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $children;
|
||||
|
|
|
@ -33,7 +33,9 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Class Manufacturer.
|
||||
* This entity represents a manufacturer of a part (The company that produces the part).
|
||||
*
|
||||
* @extends AbstractCompany<ManufacturerAttachment, ManufacturerParameter>
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: ManufacturerRepository::class)]
|
||||
#[ORM\Table('`manufacturers`')]
|
||||
|
@ -45,9 +47,6 @@ class Manufacturer extends AbstractCompany
|
|||
#[ORM\JoinColumn(name: 'parent_id')]
|
||||
protected ?AbstractStructuralDBElement $parent = null;
|
||||
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: 'Manufacturer', mappedBy: 'parent')]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $children;
|
||||
|
|
|
@ -38,6 +38,8 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
/**
|
||||
* This unit represents the unit in which the amount of parts in stock are measured.
|
||||
* This could be something like N, grams, meters, etc...
|
||||
*
|
||||
* @extends AbstractPartsContainingDBElement<MeasurementUnitAttachment,MeasurementUnitParameter>
|
||||
*/
|
||||
#[UniqueEntity('unit')]
|
||||
#[ORM\Entity(repositoryClass: MeasurementUnitRepository::class)]
|
||||
|
@ -72,9 +74,6 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
|
|||
#[ORM\Column(type: Types::BOOLEAN, name: 'use_si_prefix')]
|
||||
protected bool $use_si_prefix = false;
|
||||
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: 'MeasurementUnit', mappedBy: 'parent', cascade: ['persist'])]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $children;
|
||||
|
|
|
@ -36,7 +36,8 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
|||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Class Store location.
|
||||
* This entity represents a storage location, where parts can be stored.
|
||||
* @extends AbstractPartsContainingDBElement<StorelocationAttachment, StorelocationParameter>
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: StorelocationRepository::class)]
|
||||
#[ORM\Table('`storelocations`')]
|
||||
|
@ -44,9 +45,6 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
#[ORM\Index(name: 'location_idx_parent_name', columns: ['parent_id', 'name'])]
|
||||
class Storelocation extends AbstractPartsContainingDBElement
|
||||
{
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: 'Storelocation', mappedBy: 'parent')]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $children;
|
||||
|
|
|
@ -39,7 +39,9 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
|||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Class Supplier.
|
||||
* This entity represents a supplier of parts (the company that sells the parts).
|
||||
*
|
||||
* @extends AbstractCompany<SupplierAttachment, SupplierParameter>
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: SupplierRepository::class)]
|
||||
#[ORM\Table('`suppliers`')]
|
||||
|
@ -47,9 +49,6 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
#[ORM\Index(name: 'supplier_idx_parent_name', columns: ['parent_id', 'name'])]
|
||||
class Supplier extends AbstractCompany
|
||||
{
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: 'Supplier', mappedBy: 'parent')]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $children;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue