mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-30 21:44:28 +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
|
@ -83,59 +83,59 @@ abstract class AbstractParameter extends AbstractNamedDBElement
|
|||
|
||||
/**
|
||||
* @var string The mathematical symbol for this specification. Can be rendered pretty later. Should be short
|
||||
* @Assert\Length(max=20)
|
||||
* @ORM\Column(type="string", nullable=false)
|
||||
* @Groups({"full"})
|
||||
*/
|
||||
#[Assert\Length(max: 20)]
|
||||
#[Groups(['full'])]
|
||||
protected string $symbol = '';
|
||||
|
||||
/**
|
||||
* @var float|null the guaranteed minimum value of this property
|
||||
* @Assert\Type({"float","null"})
|
||||
* @Assert\LessThanOrEqual(propertyPath="value_typical", message="parameters.validator.min_lesser_typical")
|
||||
* @Assert\LessThan(propertyPath="value_max", message="parameters.validator.min_lesser_max")
|
||||
* @ORM\Column(type="float", nullable=true)
|
||||
* @Groups({"full"})
|
||||
*/
|
||||
#[Assert\Type(['float', null])]
|
||||
#[Assert\LessThanOrEqual(propertyPath: 'value_typical', message: 'parameters.validator.min_lesser_typical')]
|
||||
#[Assert\LessThan(propertyPath: 'value_max', message: 'parameters.validator.min_lesser_max')]
|
||||
#[Groups(['full'])]
|
||||
protected ?float $value_min = null;
|
||||
|
||||
/**
|
||||
* @var float|null the typical value of this property
|
||||
* @Assert\Type({"null", "float"})
|
||||
* @ORM\Column(type="float", nullable=true)
|
||||
* @Groups({"full"})
|
||||
*/
|
||||
#[Assert\Type([null, 'float'])]
|
||||
#[Groups(['full'])]
|
||||
protected ?float $value_typical = null;
|
||||
|
||||
/**
|
||||
* @var float|null the maximum value of this property
|
||||
* @Assert\Type({"float", "null"})
|
||||
* @Assert\GreaterThanOrEqual(propertyPath="value_typical", message="parameters.validator.max_greater_typical")
|
||||
* @ORM\Column(type="float", nullable=true)
|
||||
* @Groups({"full"})
|
||||
*/
|
||||
#[Assert\Type(['float', null])]
|
||||
#[Assert\GreaterThanOrEqual(propertyPath: 'value_typical', message: 'parameters.validator.max_greater_typical')]
|
||||
#[Groups(['full'])]
|
||||
protected ?float $value_max = null;
|
||||
|
||||
/**
|
||||
* @var string The unit in which the value values are given (e.g. V)
|
||||
* @ORM\Column(type="string", nullable=false)
|
||||
* @Groups({"full"})
|
||||
*/
|
||||
#[Groups(['full'])]
|
||||
protected string $unit = '';
|
||||
|
||||
/**
|
||||
* @var string a text value for the given property
|
||||
* @ORM\Column(type="string", nullable=false)
|
||||
* @Groups({"full"})
|
||||
*/
|
||||
#[Groups(['full'])]
|
||||
protected string $value_text = '';
|
||||
|
||||
/**
|
||||
* @var string the group this parameter belongs to
|
||||
* @ORM\Column(type="string", nullable=false, name="param_group")
|
||||
* @Groups({"full"})
|
||||
* @Groups({"full"})
|
||||
*/
|
||||
#[Groups(['full'])]
|
||||
#[Groups(['full'])]
|
||||
protected string $group = '';
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class AttachmentTypeParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = AttachmentType::class;
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class CategoryParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Category::class;
|
||||
|
|
|
@ -50,8 +50,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
* An attachment attached to a category element.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class CurrencyParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Currency::class;
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class FootprintParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Footprint::class;
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class GroupParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Group::class;
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class ManufacturerParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Manufacturer::class;
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class MeasurementUnitParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = MeasurementUnit::class;
|
||||
|
|
|
@ -50,8 +50,8 @@ trait ParametersTrait
|
|||
* Mapping done in subclasses.
|
||||
*
|
||||
* @var Collection<int, AbstractParameter>
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
#[Assert\Valid]
|
||||
protected Collection $parameters;
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class PartParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Part::class;
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class ProjectParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Project::class;
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class StorelocationParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Storelocation::class;
|
||||
|
|
|
@ -48,8 +48,8 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
|
||||
* @UniqueEntity(fields={"name", "group", "element"})
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
class SupplierParameter extends AbstractParameter
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Supplier::class;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue