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

@ -51,7 +51,7 @@ use Symfony\Component\Validator\Constraints as Assert;
use function sprintf;
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\InheritanceType('SINGLE_TABLE')]
#[ORM\DiscriminatorColumn(name: 'type', type: 'smallint')]
#[ORM\DiscriminatorMap([0 => 'CategoryParameter', 1 => 'CurrencyParameter', 2 => 'ProjectParameter', 3 => 'FootprintParameter', 4 => 'GroupParameter', 5 => 'ManufacturerParameter', 6 => 'MeasurementUnitParameter', 7 => 'PartParameter', 8 => 'StorelocationParameter', 9 => 'SupplierParameter', 10 => 'AttachmentTypeParameter'])]
@ -187,7 +187,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
$str .= ')';
}
if ($this->value_text) {
if ($this->value_text !== '' && $this->value_text !== '0') {
$str .= ' ['.$this->value_text.']';
}
@ -317,7 +317,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/**
* Sets the typical value of this property.
*
* @param float|null $value_typical
*
* @return $this
*/

View file

@ -47,14 +47,14 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class AttachmentTypeParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = AttachmentType::class;
final public const ALLOWED_ELEMENT_CLASS = AttachmentType::class;
/**
* @var AttachmentType the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Attachments\AttachmentType', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\Attachments\AttachmentType::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,14 +47,14 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class CategoryParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Category::class;
final public const ALLOWED_ELEMENT_CLASS = Category::class;
/**
* @var Category the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Parts\Category', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Category::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -50,15 +50,15 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a category element.
*/
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class CurrencyParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Currency::class;
final public const ALLOWED_ELEMENT_CLASS = Currency::class;
/**
* @var Currency the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\PriceInformations\Currency', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\PriceInformations\Currency::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,15 +47,15 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class FootprintParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Footprint::class;
final public const ALLOWED_ELEMENT_CLASS = Footprint::class;
/**
* @var Footprint the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Parts\Footprint', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Footprint::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,15 +47,15 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class GroupParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Group::class;
final public const ALLOWED_ELEMENT_CLASS = Group::class;
/**
* @var Group the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\UserSystem\Group', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\UserSystem\Group::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,15 +47,15 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class ManufacturerParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Manufacturer::class;
final public const ALLOWED_ELEMENT_CLASS = Manufacturer::class;
/**
* @var Manufacturer the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Parts\Manufacturer', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Manufacturer::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,15 +47,15 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class MeasurementUnitParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = MeasurementUnit::class;
final public const ALLOWED_ELEMENT_CLASS = MeasurementUnit::class;
/**
* @var MeasurementUnit the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Parts\MeasurementUnit', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\MeasurementUnit::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,15 +47,15 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class PartParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Part::class;
final public const ALLOWED_ELEMENT_CLASS = Part::class;
/**
* @var Part the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Parts\Part', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Part::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,15 +47,15 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class ProjectParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Project::class;
final public const ALLOWED_ELEMENT_CLASS = Project::class;
/**
* @var Project the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\ProjectSystem\Project', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\ProjectSystem\Project::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,15 +47,15 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class StorelocationParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Storelocation::class;
final public const ALLOWED_ELEMENT_CLASS = Storelocation::class;
/**
* @var Storelocation the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Parts\Storelocation', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Storelocation::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -47,15 +47,15 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: 'App\Repository\ParameterRepository')]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
class SupplierParameter extends AbstractParameter
{
public const ALLOWED_ELEMENT_CLASS = Supplier::class;
final public const ALLOWED_ELEMENT_CLASS = Supplier::class;
/**
* @var Supplier the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Parts\Supplier', inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Supplier::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}