Use typed properties

This commit is contained in:
Jan Böhmer 2022-09-18 22:59:31 +02:00
parent 548ec2ea50
commit 51e05a8669
216 changed files with 603 additions and 698 deletions

View file

@ -64,10 +64,10 @@ class CleanAttachmentsCommand extends Command
{
protected static $defaultName = 'partdb:attachments:clean-unused|app:clean-attachments';
protected $attachment_helper;
protected $reverseSearch;
protected $mimeTypeGuesser;
protected $pathResolver;
protected AttachmentManager $attachment_helper;
protected AttachmentReverseSearch $reverseSearch;
protected MimeTypes $mimeTypeGuesser;
protected AttachmentPathResolver $pathResolver;
public function __construct(AttachmentManager $attachmentHelper, AttachmentReverseSearch $reverseSearch, AttachmentPathResolver $pathResolver)
{

View file

@ -13,7 +13,7 @@ class CheckRequirementsCommand extends Command
{
protected static $defaultName = 'partdb:check-requirements';
protected $params;
protected ContainerBagInterface $params;
public function __construct(ContainerBagInterface $params)
{

View file

@ -59,9 +59,9 @@ class UpdateExchangeRatesCommand extends Command
{
protected static $defaultName = 'partdb:currencies:update-exchange-rates|partdb:update-exchange-rates|app:update-exchange-rates';
protected $base_current;
protected $em;
protected $exchangeRateUpdater;
protected string $base_current;
protected EntityManagerInterface $em;
protected ExchangeRateUpdater $exchangeRateUpdater;
public function __construct(string $base_current, EntityManagerInterface $entityManager, ExchangeRateUpdater $exchangeRateUpdater)
{

View file

@ -44,6 +44,7 @@ namespace App\Command\Logs;
use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\LogSystem\AbstractLogEntry;
use App\Repository\LogEntryRepository;
use App\Services\ElementTypeNameGenerator;
use App\Services\LogSystem\LogEntryExtraFormatter;
use Doctrine\ORM\EntityManagerInterface;
@ -58,11 +59,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ShowEventLogCommand extends Command
{
protected static $defaultName = 'partdb:logs:show|app:show-logs';
protected $entityManager;
protected $translator;
protected $elementTypeNameGenerator;
protected $repo;
protected $formatter;
protected EntityManagerInterface $entityManager;
protected TranslatorInterface $translator;
protected ElementTypeNameGenerator $elementTypeNameGenerator;
protected LogEntryRepository $repo;
protected LogEntryExtraFormatter $formatter;
public function __construct(EntityManagerInterface $entityManager,
TranslatorInterface $translator, ElementTypeNameGenerator $elementTypeNameGenerator, LogEntryExtraFormatter $formatter)

View file

@ -80,9 +80,9 @@ class ConvertBBCodeCommand extends Command
protected static $defaultName = 'partdb:migrations:convert-bbcode|app:convert-bbcode';
protected $em;
protected $propertyAccessor;
protected $converter;
protected EntityManagerInterface $em;
protected PropertyAccessorInterface $propertyAccessor;
protected BBCodeToMarkdownConverter $converter;
public function __construct(EntityManagerInterface $entityManager, PropertyAccessorInterface $propertyAccessor)
{

View file

@ -58,9 +58,9 @@ class SetPasswordCommand extends Command
{
protected static $defaultName = 'partdb:users:set-password|app:set-password|users:set-password';
protected $entityManager;
protected $encoder;
protected $eventDispatcher;
protected EntityManagerInterface $entityManager;
protected UserPasswordHasherInterface $encoder;
protected EventDispatcherInterface $eventDispatcher;
public function __construct(EntityManagerInterface $entityManager, UserPasswordHasherInterface $passwordEncoder, EventDispatcherInterface $eventDispatcher)
{

View file

@ -14,7 +14,7 @@ class UserListCommand extends Command
{
protected static $defaultName = 'partdb:users:list|users:list';
protected $entityManager;
protected EntityManagerInterface $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{

View file

@ -13,8 +13,8 @@ class VersionCommand extends Command
{
protected static $defaultName = 'partdb:version|app:version';
protected $versionManager;
protected $gitVersionInfo;
protected VersionManagerInterface $versionManager;
protected GitVersionInfo $gitVersionInfo;
public function __construct(VersionManagerInterface $versionManager, GitVersionInfo $gitVersionInfo)
{
@ -43,7 +43,7 @@ class VersionCommand extends Command
$io->success($message);
$io->info('PHP version: '. phpversion());
$io->info('PHP version: '.PHP_VERSION);
$io->info('Symfony version: ' . $this->getApplication()->getVersion());
$io->info('OS: '. php_uname());
$io->info('PHP extension: '. implode(', ', get_loaded_extensions()));

View file

@ -90,22 +90,22 @@ abstract class BaseAdminController extends AbstractController
protected $attachment_class = '';
protected $parameter_class = '';
protected $passwordEncoder;
protected $translator;
protected $attachmentSubmitHandler;
protected $commentHelper;
protected UserPasswordHasherInterface $passwordEncoder;
protected TranslatorInterface $translator;
protected AttachmentSubmitHandler $attachmentSubmitHandler;
protected EventCommentHelper $commentHelper;
protected $historyHelper;
protected $timeTravel;
protected $dataTableFactory;
protected HistoryHelper $historyHelper;
protected TimeTravel $timeTravel;
protected DataTableFactory $dataTableFactory;
/**
* @var EventDispatcher|EventDispatcherInterface
*/
protected $eventDispatcher;
protected $labelGenerator;
protected $barcodeExampleGenerator;
protected LabelGenerator $labelGenerator;
protected BarcodeExampleElementsGenerator $barcodeExampleGenerator;
protected $entityManager;
protected EntityManagerInterface $entityManager;
public function __construct(TranslatorInterface $translator, UserPasswordHasherInterface $passwordEncoder,
AttachmentSubmitHandler $attachmentSubmitHandler,

View file

@ -84,7 +84,7 @@ class CurrencyController extends BaseAdminController
protected $attachment_class = CurrencyAttachment::class;
protected $parameter_class = CurrencyParameter::class;
protected $exchangeRateUpdater;
protected ExchangeRateUpdater $exchangeRateUpdater;
public function __construct(
TranslatorInterface $translator,

View file

@ -55,9 +55,9 @@ use Symfony\Contracts\Cache\CacheInterface;
class HomepageController extends AbstractController
{
protected $cache;
protected $kernel;
protected $dataTable;
protected CacheInterface $cache;
protected KernelInterface $kernel;
protected DataTableFactory $dataTable;
public function __construct(CacheInterface $cache, KernelInterface $kernel, DataTableFactory $dataTable)
{

View file

@ -46,11 +46,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
class LabelController extends AbstractController
{
protected $labelGenerator;
protected $em;
protected $elementTypeNameGenerator;
protected $rangeParser;
protected $translator;
protected LabelGenerator $labelGenerator;
protected EntityManagerInterface $em;
protected ElementTypeNameGenerator $elementTypeNameGenerator;
protected RangeParser $rangeParser;
protected TranslatorInterface $translator;
public function __construct(LabelGenerator $labelGenerator, EntityManagerInterface $em, ElementTypeNameGenerator $elementTypeNameGenerator,
RangeParser $rangeParser, TranslatorInterface $translator)

View file

@ -54,6 +54,7 @@ use App\Form\Filters\LogFilterType;
use App\Services\LogSystem\EventUndoHelper;
use App\Services\LogSystem\TimeTravel;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use InvalidArgumentException;
use Omines\DataTablesBundle\DataTableFactory;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -68,9 +69,9 @@ use Symfony\Component\Routing\Annotation\Route;
*/
class LogController extends AbstractController
{
protected $entityManager;
protected $timeTravel;
protected $dbRepository;
protected EntityManagerInterface $entityManager;
protected TimeTravel $timeTravel;
protected EntityRepository $dbRepository;
public function __construct(EntityManagerInterface $entityManager, TimeTravel $timeTravel)
{

View file

@ -77,9 +77,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
class PartController extends AbstractController
{
protected $pricedetailHelper;
protected $partPreviewGenerator;
protected $commentHelper;
protected PricedetailHelper $pricedetailHelper;
protected PartPreviewGenerator $partPreviewGenerator;
protected EventCommentHelper $commentHelper;
public function __construct(PricedetailHelper $pricedetailHelper,
PartPreviewGenerator $partPreviewGenerator, EventCommentHelper $commentHelper)

View file

@ -64,9 +64,9 @@ use Symfony\Component\Routing\Annotation\Route;
class PartListsController extends AbstractController
{
private $entityManager;
private $nodesListBuilder;
private $dataTableFactory;
private EntityManagerInterface $entityManager;
private NodesListBuilder $nodesListBuilder;
private DataTableFactory $dataTableFactory;
public function __construct(EntityManagerInterface $entityManager, NodesListBuilder $nodesListBuilder, DataTableFactory $dataTableFactory)
{

View file

@ -53,10 +53,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class RedirectController extends AbstractController
{
protected $default_locale;
protected $translator;
protected $session;
protected $enforce_index_php;
protected string $default_locale;
protected TranslatorInterface $translator;
protected SessionInterface $session;
protected bool $enforce_index_php;
public function __construct(string $default_locale, TranslatorInterface $translator, SessionInterface $session, bool $enforce_index_php)
{

View file

@ -38,8 +38,8 @@ use Symfony\Component\Routing\Annotation\Route;
*/
class ScanController extends AbstractController
{
protected $barcodeParser;
protected $barcodeNormalizer;
protected BarcodeRedirector $barcodeParser;
protected BarcodeNormalizer $barcodeNormalizer;
public function __construct(BarcodeRedirector $barcodeParser, BarcodeNormalizer $barcodeNormalizer)
{

View file

@ -68,8 +68,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class SecurityController extends AbstractController
{
protected $translator;
protected $allow_email_pw_reset;
protected TranslatorInterface $translator;
protected bool $allow_email_pw_reset;
public function __construct(TranslatorInterface $translator, bool $allow_email_pw_reset)
{

View file

@ -36,8 +36,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
class SelectAPIController extends AbstractController
{
private $nodesListBuilder;
private $translator;
private NodesListBuilder $nodesListBuilder;
private TranslatorInterface $translator;
public function __construct(NodesListBuilder $nodesListBuilder, TranslatorInterface $translator)
{

View file

@ -61,7 +61,7 @@ use Symfony\Component\Routing\Annotation\Route;
*/
class TreeController extends AbstractController
{
protected $treeGenerator;
protected TreeViewGenerator $treeGenerator;
public function __construct(TreeViewGenerator $treeGenerator)
{

View file

@ -74,8 +74,8 @@ use Symfony\Component\Serializer\Serializer;
*/
class TypeaheadController extends AbstractController
{
protected $urlGenerator;
protected $assets;
protected AttachmentURLGenerator $urlGenerator;
protected Packages $assets;
public function __construct(AttachmentURLGenerator $URLGenerator, Packages $assets)
{

View file

@ -73,7 +73,8 @@ use Symfony\Component\Validator\Constraints\Length;
*/
class UserSettingsController extends AbstractController
{
protected $demo_mode;
protected bool $demo_mode;
/**
* @var EventDispatcher|EventDispatcherInterface
*/

View file

@ -58,7 +58,7 @@ use InvalidArgumentException;
class DataStructureFixtures extends Fixture
{
protected $em;
protected EntityManagerInterface $em;
public function __construct(EntityManagerInterface $entityManager)
{

View file

@ -31,7 +31,7 @@ use Doctrine\Persistence\ObjectManager;
class LabelProfileFixtures extends Fixture
{
protected $em;
protected EntityManagerInterface $em;
public function __construct(EntityManagerInterface $entityManager)
{

View file

@ -42,7 +42,7 @@ use Doctrine\Persistence\ObjectManager;
class PartFixtures extends Fixture
{
protected $em;
protected EntityManagerInterface $em;
public function __construct(EntityManagerInterface $entityManager)
{

View file

@ -50,8 +50,8 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
class UserFixtures extends Fixture
{
protected $encoder;
protected $em;
protected UserPasswordHasherInterface $encoder;
protected EntityManagerInterface $em;
public function __construct(UserPasswordHasherInterface $encoder, EntityManagerInterface $entityManager)
{

View file

@ -60,11 +60,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final class AttachmentDataTable implements DataTableTypeInterface
{
private $translator;
private $entityURLGenerator;
private $attachmentHelper;
private $elementTypeNameGenerator;
private $attachmentURLGenerator;
private TranslatorInterface $translator;
private EntityURLGenerator $entityURLGenerator;
private AttachmentManager $attachmentHelper;
private ElementTypeNameGenerator $elementTypeNameGenerator;
private AttachmentURLGenerator $attachmentURLGenerator;
public function __construct(TranslatorInterface $translator, EntityURLGenerator $entityURLGenerator,
AttachmentManager $attachmentHelper, AttachmentURLGenerator $attachmentURLGenerator,

View file

@ -53,8 +53,8 @@ use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
class EntityColumn extends AbstractColumn
{
protected $urlGenerator;
protected $accessor;
protected EntityURLGenerator $urlGenerator;
protected PropertyAccessorInterface $accessor;
public function __construct(EntityURLGenerator $URLGenerator, PropertyAccessorInterface $accessor)
{

View file

@ -48,8 +48,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class LogEntryExtraColumn extends AbstractColumn
{
protected $translator;
protected $formatter;
protected TranslatorInterface $translator;
protected LogEntryExtraFormatter $formatter;
public function __construct(TranslatorInterface $translator, LogEntryExtraFormatter $formatter)
{

View file

@ -52,6 +52,7 @@ use App\Entity\Parts\PartLot;
use App\Entity\PriceInformations\Orderdetail;
use App\Entity\PriceInformations\Pricedetail;
use App\Exceptions\EntityNotSupportedException;
use App\Repository\LogEntryRepository;
use App\Services\ElementTypeNameGenerator;
use App\Services\EntityURLGenerator;
use Doctrine\ORM\EntityManagerInterface;
@ -61,11 +62,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class LogEntryTargetColumn extends AbstractColumn
{
protected $em;
protected $entryRepository;
protected $entityURLGenerator;
protected $elementTypeNameGenerator;
protected $translator;
protected EntityManagerInterface $em;
protected LogEntryRepository $entryRepository;
protected EntityURLGenerator $entityURLGenerator;
protected ElementTypeNameGenerator $elementTypeNameGenerator;
protected TranslatorInterface $translator;
public function __construct(EntityManagerInterface $entityManager, EntityURLGenerator $entityURLGenerator,
ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator)

View file

@ -47,7 +47,7 @@ use Omines\DataTablesBundle\Column\AbstractColumn;
class MarkdownColumn extends AbstractColumn
{
protected $markdown;
protected MarkdownParser $markdown;
public function __construct(MarkdownParser $markdown)
{

View file

@ -53,9 +53,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PartAttachmentsColumn extends AbstractColumn
{
protected $FAIconGenerator;
protected $urlGenerator;
protected $attachmentManager;
protected FAIconGenerator $FAIconGenerator;
protected EntityURLGenerator $urlGenerator;
protected AttachmentManager $attachmentManager;
public function __construct(FAIconGenerator $FAIconGenerator, EntityURLGenerator $urlGenerator, AttachmentManager $attachmentManager)
{

View file

@ -7,8 +7,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class PrettyBoolColumn extends AbstractColumn
{
protected $translator;
protected TranslatorInterface $translator;
public function __construct(TranslatorInterface $translator)
{

View file

@ -33,8 +33,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class RevertLogColumn extends AbstractColumn
{
protected $translator;
protected $security;
protected TranslatorInterface $translator;
protected Security $security;
public function __construct(TranslatorInterface $translator, Security $security)
{

View file

@ -8,7 +8,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class SIUnitNumberColumn extends AbstractColumn
{
protected $formatter;
protected SIFormatter $formatter;
public function __construct(SIFormatter $formatter)
{

View file

@ -47,7 +47,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class TagsColumn extends AbstractColumn
{
protected $urlGenerator;
protected UrlGeneratorInterface $urlGenerator;
public function __construct(UrlGeneratorInterface $urlGenerator)
{

View file

@ -17,26 +17,13 @@ class AttachmentFilter implements FilterInterface
{
use CompoundFilterTrait;
/** @var NumberConstraint */
protected $dbId;
/** @var InstanceOfConstraint */
protected $targetType;
/** @var TextConstraint */
protected $name;
/** @var EntityConstraint */
protected $attachmentType;
/** @var BooleanConstraint */
protected $showInTable;
/** @var DateTimeConstraint */
protected $lastModified;
/** @var DateTimeConstraint */
protected $addedDate;
protected NumberConstraint $dbId;
protected InstanceOfConstraint $targetType;
protected TextConstraint $name;
protected EntityConstraint $attachmentType;
protected BooleanConstraint $showInTable;
protected DateTimeConstraint $lastModified;
protected DateTimeConstraint $addedDate;
public function __construct(NodesListBuilder $nodesListBuilder)

View file

@ -12,12 +12,12 @@ abstract class AbstractConstraint implements FilterInterface
/**
* @var string The property where this BooleanConstraint should apply to
*/
protected $property;
protected string $property;
/**
* @var string
*/
protected $identifier;
protected string $identifier;
/**

View file

@ -8,7 +8,7 @@ use Doctrine\ORM\QueryBuilder;
class BooleanConstraint extends AbstractConstraint
{
/** @var bool|null The value of our constraint */
protected $value;
protected ?bool $value;
public function __construct(string $property, string $identifier = null, ?bool $default_value = null)

View file

@ -11,12 +11,12 @@ class ChoiceConstraint extends AbstractConstraint
/**
* @var string[]|int[] The values to compare to
*/
protected $value;
protected array $value;
/**
* @var string The operator to use
*/
protected $operator;
protected string $operator;
/**
* @return string[]|int[]

View file

@ -18,17 +18,17 @@ class EntityConstraint extends AbstractConstraint
/**
* @var NodesListBuilder
*/
protected $nodesListBuilder;
protected ?NodesListBuilder $nodesListBuilder;
/**
* @var class-string<T> The class to use for the comparison
*/
protected $class;
protected string $class;
/**
* @var string|null The operator to use
*/
protected $operator;
protected ?string $operator;
/**
* @var T The value to compare to

View file

@ -8,7 +8,7 @@ use Doctrine\ORM\QueryBuilder;
trait FilterTrait
{
protected $useHaving = false;
protected bool $useHaving = false;
public function useHaving($value = true): self
{

View file

@ -14,12 +14,12 @@ class InstanceOfConstraint extends AbstractConstraint
/**
* @var string[] The values to compare to (fully qualified class names)
*/
protected $value;
protected array $value;
/**
* @var string The operator to use
*/
protected $operator;
protected string $operator;
/**
* @return string[]

View file

@ -26,7 +26,7 @@ class NumberConstraint extends AbstractConstraint
/**
* @var string The operator to use
*/
protected $operator;
protected ?string $operator;
/**
* @return float|int|null|\DateTimeInterface

View file

@ -11,22 +11,22 @@ use Svg\Tag\Text;
class ParameterConstraint extends AbstractConstraint
{
/** @var string */
protected $name;
protected string $name;
/** @var string */
protected $symbol;
protected string $symbol;
/** @var string */
protected $unit;
protected string $unit;
/** @var TextConstraint */
protected $value_text;
protected TextConstraint $value_text;
/** @var ParameterValueConstraint */
protected $value;
protected ParameterValueConstraint $value;
/** @var string The alias to use for the subquery */
protected $alias;
protected string $alias;
public function __construct()
{

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\QueryBuilder;
class ParameterValueConstraint extends NumberConstraint
{
protected $alias;
protected string $alias;
public const ALLOWED_OPERATOR_VALUES = ['=', '!=', '<', '>', '<=', '>=', 'BETWEEN',
//Additional operators

View file

@ -13,7 +13,7 @@ class TagsConstraint extends AbstractConstraint
/**
* @var string|null The operator to use
*/
protected $operator;
protected ?string $operator;
/**
* @var string The value to compare to

View file

@ -12,7 +12,7 @@ class TextConstraint extends AbstractConstraint
/**
* @var string|null The operator to use
*/
protected $operator;
protected ?string $operator;
/**
* @var string The value to compare to

View file

@ -15,26 +15,13 @@ class LogFilter implements FilterInterface
{
use CompoundFilterTrait;
/** @var DateTimeConstraint */
protected $timestamp;
/** @var IntConstraint */
protected $dbId;
/** @var ChoiceConstraint */
protected $level;
/** @var InstanceOfConstraint */
protected $eventType;
/** @var ChoiceConstraint */
protected $targetType;
/** @var IntConstraint */
protected $targetId;
/** @var EntityConstraint */
protected $user;
protected DateTimeConstraint $timestamp;
protected IntConstraint $dbId;
protected ChoiceConstraint $level;
protected InstanceOfConstraint $eventType;
protected ChoiceConstraint $targetType;
protected IntConstraint $targetId;
protected EntityConstraint $user;
public function __construct()
{

View file

@ -28,104 +28,40 @@ class PartFilter implements FilterInterface
use CompoundFilterTrait;
/** @var NumberConstraint */
protected $dbId;
/** @var TextConstraint */
protected $name;
/** @var TextConstraint */
protected $description;
/** @var TextConstraint */
protected $comment;
/** @var TagsConstraint */
protected $tags;
/** @var NumberConstraint */
protected $minAmount;
/** @var BooleanConstraint */
protected $favorite;
/** @var BooleanConstraint */
protected $needsReview;
/** @var NumberConstraint */
protected $mass;
/** @var DateTimeConstraint */
protected $lastModified;
/** @var DateTimeConstraint */
protected $addedDate;
/** @var EntityConstraint */
protected $category;
/** @var EntityConstraint */
protected $footprint;
/** @var EntityConstraint */
protected $manufacturer;
/** @var ChoiceConstraint */
protected $manufacturing_status;
/** @var EntityConstraint */
protected $supplier;
/** @var IntConstraint */
protected $orderdetailsCount;
/** @var BooleanConstraint */
protected $obsolete;
/** @var EntityConstraint */
protected $storelocation;
/** @var IntConstraint */
protected $lotCount;
/** @var NumberConstraint */
protected $amountSum;
/** @var BooleanConstraint */
protected $lotNeedsRefill;
/** @var TextConstraint */
protected $lotDescription;
/** @var BooleanConstraint */
protected $lotUnknownAmount;
/** @var DateTimeConstraint */
protected $lotExpirationDate;
/** @var EntityConstraint */
protected $measurementUnit;
/** @var TextConstraint */
protected $manufacturer_product_url;
/** @var TextConstraint */
protected $manufacturer_product_number;
/** @var IntConstraint */
protected $attachmentsCount;
/** @var EntityConstraint */
protected $attachmentType;
/** @var TextConstraint */
protected $attachmentName;
protected IntConstraint $dbId;
protected TextConstraint $name;
protected TextConstraint $description;
protected TextConstraint $comment;
protected TagsConstraint $tags;
protected NumberConstraint $minAmount;
protected BooleanConstraint $favorite;
protected BooleanConstraint $needsReview;
protected NumberConstraint $mass;
protected DateTimeConstraint $lastModified;
protected DateTimeConstraint $addedDate;
protected EntityConstraint $category;
protected EntityConstraint $footprint;
protected EntityConstraint $manufacturer;
protected ChoiceConstraint $manufacturing_status;
protected EntityConstraint $supplier;
protected IntConstraint $orderdetailsCount;
protected BooleanConstraint $obsolete;
protected EntityConstraint $storelocation;
protected IntConstraint $lotCount;
protected IntConstraint $amountSum;
protected BooleanConstraint $lotNeedsRefill;
protected TextConstraint $lotDescription;
protected BooleanConstraint $lotUnknownAmount;
protected DateTimeConstraint $lotExpirationDate;
protected EntityConstraint $measurementUnit;
protected TextConstraint $manufacturer_product_url;
protected TextConstraint $manufacturer_product_number;
protected IntConstraint $attachmentsCount;
protected EntityConstraint $attachmentType;
protected TextConstraint $attachmentName;
/** @var ArrayCollection<int, ParameterConstraint> */
protected $parameters;
/** @var IntConstraint */
protected $parametersCount;
protected ArrayCollection $parameters;
protected IntConstraint $parametersCount;
public function __construct(NodesListBuilder $nodesListBuilder)
{

View file

@ -9,43 +9,43 @@ class PartSearchFilter implements FilterInterface
{
/** @var string The string to query for */
protected $keyword;
protected string $keyword;
/** @var boolean Whether to use regex for searching */
protected $regex = false;
protected bool $regex = false;
/** @var bool Use name field for searching */
protected $name = true;
protected bool $name = true;
/** @var bool Use category name for searching */
protected $category = true;
protected bool $category = true;
/** @var bool Use description for searching */
protected $description = true;
protected bool $description = true;
/** @var bool Use tags for searching */
protected $tags = true;
protected bool $tags = true;
/** @var bool Use storelocation name for searching */
protected $storelocation = true;
protected bool $storelocation = true;
/** @var bool Use comment field for searching */
protected $comment = true;
protected bool $comment = true;
/** @var bool Use ordernr for searching */
protected $ordernr = true;
protected bool $ordernr = true;
/** @var bool Use manufacturer product name for searching */
protected $mpn = true;
protected bool $mpn = true;
/** @var bool Use supplier name for searching */
protected $supplier = false;
protected bool $supplier = false;
/** @var bool Use manufacturer name for searching */
protected $manufacturer = false;
protected bool $manufacturer = false;
/** @var bool Use footprint name for searching */
protected $footprint = false;
protected bool $footprint = false;
public function __construct(string $query)
{

View file

@ -59,6 +59,7 @@ use App\Entity\LogSystem\ElementEditedLogEntry;
use App\Entity\UserSystem\Group;
use App\Entity\UserSystem\User;
use App\Exceptions\EntityNotSupportedException;
use App\Repository\LogEntryRepository;
use App\Services\ElementTypeNameGenerator;
use App\Services\EntityURLGenerator;
use Doctrine\ORM\EntityManagerInterface;
@ -77,12 +78,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class LogDataTable implements DataTableTypeInterface
{
protected $elementTypeNameGenerator;
protected $translator;
protected $urlGenerator;
protected $entityURLGenerator;
protected $logRepo;
protected $security;
protected ElementTypeNameGenerator $elementTypeNameGenerator;
protected TranslatorInterface $translator;
protected UrlGeneratorInterface $urlGenerator;
protected EntityURLGenerator $entityURLGenerator;
protected LogEntryRepository $logRepo;
protected Security $security;
public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator,
UrlGeneratorInterface $urlGenerator, EntityURLGenerator $entityURLGenerator, EntityManagerInterface $entityManager, Security $security)

View file

@ -79,12 +79,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final class PartsDataTable implements DataTableTypeInterface
{
private $translator;
private $treeBuilder;
private $amountFormatter;
private $previewGenerator;
private $attachmentURLGenerator;
private $security;
private TranslatorInterface $translator;
private NodesListBuilder $treeBuilder;
private AmountFormatter $amountFormatter;
private PartPreviewGenerator $previewGenerator;
private AttachmentURLGenerator $attachmentURLGenerator;
private Security $security;
/**
* @var EntityURLGenerator

View file

@ -82,24 +82,24 @@ abstract class Attachment extends AbstractNamedDBElement
* @var string|null the original filename the file had, when the user uploaded it
* @ORM\Column(type="string", nullable=true)
*/
protected $original_filename;
protected ?string $original_filename = null;
/**
* @var string The path to the file relative to a placeholder path like %MEDIA%
* @ORM\Column(type="string", name="path")
*/
protected $path = '';
protected string $path = '';
/**
* ORM mapping is done in sub classes (like PartAttachment).
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $show_in_table = false;
protected bool $show_in_table = false;
/**
* @var AttachmentType
@ -108,7 +108,7 @@ abstract class Attachment extends AbstractNamedDBElement
* @Selectable()
* @Assert\NotNull(message="validator.attachment.must_not_be_null")
*/
protected $attachment_type;
protected ?AttachmentType $attachment_type = null;
public function __construct()
{

View file

@ -55,7 +55,7 @@ class AttachmentType extends AbstractStructuralDBElement
* @ORM\Column(type="text")
* @ValidFileFilter
*/
protected $filetype_filter = '';
protected string $filetype_filter = '';
/**
* @var Collection<int, AttachmentTypeAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)

View file

@ -59,5 +59,5 @@ class AttachmentTypeAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\AttachmentType", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class CategoryAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Category", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class CurrencyAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\PriceInformations\Currency", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class DeviceAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Devices\Device", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class FootprintAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Footprint", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class GroupAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\Group", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -42,5 +42,5 @@ class LabelAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\LabelSystem\LabelProfile", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class ManufacturerAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Manufacturer", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -61,5 +61,5 @@ class MeasurementUnitAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\MeasurementUnit", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class PartAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class StorelocationAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Storelocation", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class SupplierAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -60,5 +60,5 @@ class UserAttachment extends Attachment
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
*/
protected $element;
protected ?AttachmentContainingDBElement $element = null;
}

View file

@ -57,39 +57,39 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
* @var string The address of the company
* @ORM\Column(type="string")
*/
protected $address = '';
protected string $address = '';
/**
* @var string The phone number of the company
* @ORM\Column(type="string")
*/
protected $phone_number = '';
protected string $phone_number = '';
/**
* @var string The fax number of the company
* @ORM\Column(type="string")
*/
protected $fax_number = '';
protected string $fax_number = '';
/**
* @var string The email address of the company
* @ORM\Column(type="string")
* @Assert\Email()
*/
protected $email_address = '';
protected string $email_address = '';
/**
* @var string The website of the company
* @ORM\Column(type="string")
* @Assert\Url()
*/
protected $website = '';
protected string $website = '';
/**
* @var string
* @ORM\Column(type="string")
*/
protected $auto_product_url = '';
protected string $auto_product_url = '';
/********************************************************************************
*

View file

@ -65,7 +65,7 @@ abstract class AbstractDBElement implements JsonSerializable
* @ORM\GeneratedValue()
* @Groups({"full"})
*/
protected $id;
protected ?int $id = null;
public function __clone()
{

View file

@ -44,7 +44,7 @@ abstract class AbstractNamedDBElement extends AbstractDBElement implements Named
* @Assert\NotBlank()
* @Groups({"simple", "extended", "full"})
*/
protected $name = '';
protected string $name = '';
/******************************************************************************
*

View file

@ -65,19 +65,19 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
* @ORM\Column(type="text")
* @Groups({"simple", "extended", "full"})
*/
protected $comment = '';
protected string $comment = '';
/**
* @var bool If this property is set, this element can not be selected for part properties.
* Useful if this element should be used only for grouping, sorting.
* @ORM\Column(type="boolean")
*/
protected $not_selectable = false;
protected bool $not_selectable = false;
/**
* @var int
*/
protected $level = 0;
protected int $level = 0;
/**
* We can not define the mapping here or we will get an exception. Unfortunately we have to do the mapping in the
@ -98,7 +98,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
/** @var string[] all names of all parent elements as a array of strings,
* the last array element is the name of the element itself
*/
private $full_path_strings = [];
private array $full_path_strings = [];
public function __construct()
{

View file

@ -57,7 +57,7 @@ trait MasterAttachmentTrait
* @ORM\JoinColumn(name="id_preview_attachement", referencedColumnName="id")
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture")
*/
protected $master_picture_attachment;
protected ?Attachment $master_picture_attachment = null;
/**
* Get the master picture "Attachment"-object of this part (if there is one).

View file

@ -56,14 +56,14 @@ trait TimestampTrait
* @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"})
* @Groups({"extended", "full"})
*/
protected $lastModified;
protected ?DateTime $lastModified = null;
/**
* @var DateTime|null the date when this element was created
* @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"})
* @Groups({"extended", "full"})
*/
protected $addedDate;
protected ?DateTime $addedDate = null;
/**
* Returns the last time when the element was modified.

View file

@ -84,16 +84,14 @@ class Device extends AbstractPartsContainingDBElement
protected $parts;
/**
* @var int
* @ORM\Column(type="integer")
*/
protected $order_quantity = 0;
protected int $order_quantity = 0;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $order_only_missing_parts = false;
protected bool $order_only_missing_parts = false;
/**
* @var Collection<int, DeviceAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\DeviceAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)

View file

@ -66,24 +66,24 @@ class DevicePart extends AbstractDBElement
* @var int
* @ORM\Column(type="integer", name="quantity")
*/
protected $quantity;
protected int $quantity;
/**
* @var string
* @ORM\Column(type="text", name="mountnames")
*/
protected $mountnames;
protected string $mountnames;
/**
* @var Device
* @ORM\ManyToOne(targetEntity="Device", inversedBy="parts")
* @ORM\JoinColumn(name="id_device", referencedColumnName="id")
*/
protected $device;
protected Device $device;
/**
* @var Part
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part")
* @ORM\JoinColumn(name="id_part", referencedColumnName="id")
*/
protected $part;
protected Part $part;
}

View file

@ -42,53 +42,53 @@ class LabelOptions
* @Assert\Positive()
* @ORM\Column(type="float")
*/
protected $width = 50.0;
protected float $width = 50.0;
/**
* @var float The page size of the label in mm
* @Assert\Positive()
* @ORM\Column(type="float")
*/
protected $height = 30.0;
protected float $height = 30.0;
/**
* @var string The type of the barcode that should be used in the label (e.g. 'qr')
* @Assert\Choice(choices=LabelOptions::BARCODE_TYPES)
* @ORM\Column(type="string")
*/
protected $barcode_type = 'none';
protected string $barcode_type = 'none';
/**
* @var string What image should be shown along the
* @Assert\Choice(choices=LabelOptions::PICTURE_TYPES)
* @ORM\Column(type="string")
*/
protected $picture_type = 'none';
protected string $picture_type = 'none';
/**
* @var string
* @Assert\Choice(choices=LabelOptions::SUPPORTED_ELEMENTS)
* @ORM\Column(type="string")
*/
protected $supported_element = 'part';
protected string $supported_element = 'part';
/**
* @var string any additional CSS for the label
* @ORM\Column(type="text")
*/
protected $additional_css = '';
protected string $additional_css = '';
/** @var string The mode that will be used to interpret the lines
* @Assert\Choice(choices=LabelOptions::LINES_MODES)
* @ORM\Column(type="string")
*/
protected $lines_mode = 'html';
protected string $lines_mode = 'html';
/**
* @var string
* @ORM\Column(type="text")
*/
protected $lines = '';
protected string $lines = '';
public function getWidth(): float
{

View file

@ -50,19 +50,19 @@ class LabelProfile extends AttachmentContainingDBElement
* @ORM\Embedded(class="LabelOptions")
* @Assert\Valid()
*/
protected $options;
protected LabelOptions $options;
/**
* @var string The comment info for this element
* @ORM\Column(type="text")
*/
protected $comment = '';
protected string $comment = '';
/**
* @var bool determines, if this label profile should be shown in the dropdown quick menu
* @ORM\Column(type="boolean")
*/
protected $show_in_dropdown = true;
protected bool $show_in_dropdown = true;
public function __construct()
{

View file

@ -161,33 +161,33 @@ abstract class AbstractLogEntry extends AbstractDBElement
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", fetch="EAGER")
* @ORM\JoinColumn(name="id_user", nullable=false)
*/
protected $user;
protected ?User $user = null;
/** @var DateTime The datetime the event associated with this log entry has occured
* @ORM\Column(type="datetime", name="datetime")
*/
protected $timestamp;
protected ?DateTime $timestamp = null;
/** @var int The priority level of the associated level. 0 is highest, 7 lowest
* @ORM\Column(type="integer", name="level", columnDefinition="TINYINT(4) NOT NULL")
*/
protected $level;
protected int $level;
/** @var int The ID of the element targeted by this event
* @ORM\Column(name="target_id", type="integer", nullable=false)
*/
protected $target_id = 0;
protected int $target_id = 0;
/** @var int The Type of the targeted element
* @ORM\Column(name="target_type", type="smallint", nullable=false)
*/
protected $target_type = 0;
protected int $target_type = 0;
/** @var string The type of this log entry, aka the description what has happened.
* The mapping between the log entry class and the discriminator column is done by doctrine.
* Each subclass should override this string to specify a better string.
*/
protected $typeString = 'unknown';
protected string $typeString = 'unknown';
/** @var array The extra data in raw (short form) saved in the DB
* @ORM\Column(name="extra", type="json")

View file

@ -36,8 +36,8 @@ use InvalidArgumentException;
*/
class CollectionElementDeleted extends AbstractLogEntry implements LogWithEventUndoInterface
{
protected $typeString = 'collection_element_deleted';
protected $level = self::LEVEL_INFO;
protected string $typeString = 'collection_element_deleted';
protected int $level = self::LEVEL_INFO;
public function __construct(AbstractDBElement $changed_element, string $collection_name, AbstractDBElement $deletedElement)
{

View file

@ -50,7 +50,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class ConfigChangedLogEntry extends AbstractLogEntry
{
protected $typeString = 'config_changed';
protected string $typeString = 'config_changed';
public function __construct()
{

View file

@ -49,7 +49,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class DatabaseUpdatedLogEntry extends AbstractLogEntry
{
protected $typeString = 'database_updated';
protected string $typeString = 'database_updated';
public function __construct(string $oldVersion, string $newVersion)
{

View file

@ -55,7 +55,7 @@ use InvalidArgumentException;
*/
class ElementCreatedLogEntry extends AbstractLogEntry implements LogWithCommentInterface, LogWithEventUndoInterface
{
protected $typeString = 'element_created';
protected string $typeString = 'element_created';
public function __construct(AbstractDBElement $new_element)
{

View file

@ -57,7 +57,7 @@ use InvalidArgumentException;
*/
class ElementDeletedLogEntry extends AbstractLogEntry implements TimeTravelInterface, LogWithCommentInterface, LogWithEventUndoInterface
{
protected $typeString = 'element_deleted';
protected string $typeString = 'element_deleted';
public function __construct(AbstractDBElement $deleted_element)
{

View file

@ -54,7 +54,7 @@ use InvalidArgumentException;
*/
class ElementEditedLogEntry extends AbstractLogEntry implements TimeTravelInterface, LogWithCommentInterface, LogWithEventUndoInterface
{
protected $typeString = 'element_edited';
protected string $typeString = 'element_edited';
public function __construct(AbstractDBElement $changed_element)
{

View file

@ -50,7 +50,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class ExceptionLogEntry extends AbstractLogEntry
{
protected $typeString = 'exception';
protected string $typeString = 'exception';
public function __construct()
{

View file

@ -49,7 +49,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class InstockChangedLogEntry extends AbstractLogEntry
{
protected $typeString = 'instock_changed';
protected string $typeString = 'instock_changed';
/**
* Get the old instock.

View file

@ -52,7 +52,7 @@ use Symfony\Component\HttpFoundation\IpUtils;
*/
class UserLoginLogEntry extends AbstractLogEntry
{
protected $typeString = 'user_login';
protected string $typeString = 'user_login';
public function __construct(string $ip_address, bool $anonymize = true)
{

View file

@ -50,7 +50,7 @@ use Symfony\Component\HttpFoundation\IpUtils;
*/
class UserLogoutLogEntry extends AbstractLogEntry
{
protected $typeString = 'user_logout';
protected string $typeString = 'user_logout';
public function __construct(string $ip_address, bool $anonymize = true)
{

View file

@ -49,7 +49,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
class UserNotAllowedLogEntry extends AbstractLogEntry
{
protected $typeString = 'user_not_allowed';
protected string $typeString = 'user_not_allowed';
public function __construct(string $path)
{

View file

@ -63,7 +63,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
* @Assert\Length(max=20)
* @ORM\Column(type="string", nullable=false)
*/
protected $symbol = '';
protected string $symbol = '';
/**
* @var float|null the guaranteed minimum value of this property
@ -72,14 +72,14 @@ abstract class AbstractParameter extends AbstractNamedDBElement
* @Assert\LessThan(propertyPath="value_max", message="parameters.validator.min_lesser_max")
* @ORM\Column(type="float", nullable=true)
*/
protected $value_min;
protected ?float $value_min = null;
/**
* @var float|null the typical value of this property
* @Assert\Type({"null", "float"})
* @ORM\Column(type="float", nullable=true)
*/
protected $value_typical;
protected ?float $value_typical = null;
/**
* @var float|null the maximum value of this property
@ -87,26 +87,26 @@ abstract class AbstractParameter extends AbstractNamedDBElement
* @Assert\GreaterThanOrEqual(propertyPath="value_typical", message="parameters.validator.max_greater_typical")
* @ORM\Column(type="float", nullable=true)
*/
protected $value_max;
protected ?float $value_max = null;
/**
* @var string The unit in which the value values are given (e.g. V)
* @Assert\Length(max=5)
* @ORM\Column(type="string", nullable=false)
*/
protected $unit = '';
protected string $unit = '';
/**
* @var string a text value for the given property
* @ORM\Column(type="string", nullable=false)
*/
protected $value_text = '';
protected string $value_text = '';
/**
* @var string the group this parameter belongs to
* @ORM\Column(type="string", nullable=false, name="param_group")
*/
protected $group = '';
protected string $group = '';
/**
* Mapping is done in sub classes.

View file

@ -54,49 +54,49 @@ class Category extends AbstractPartsContainingDBElement
* @var string
* @ORM\Column(type="text")
*/
protected $partname_hint = '';
protected string $partname_hint = '';
/**
* @var string
* @ORM\Column(type="text")
*/
protected $partname_regex = '';
protected string $partname_regex = '';
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $disable_footprints = false;
protected bool $disable_footprints = false;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $disable_manufacturers = false;
protected bool $disable_manufacturers = false;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $disable_autodatasheets = false;
protected bool $disable_autodatasheets = false;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $disable_properties = false;
protected bool $disable_properties = false;
/**
* @var string
* @ORM\Column(type="text")
*/
protected $default_description = '';
protected string $default_description = '';
/**
* @var string
* @ORM\Column(type="text")
*/
protected $default_comment = '';
protected string $default_comment = '';
/**
* @var Collection<int, CategoryAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\CategoryAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)

View file

@ -91,7 +91,7 @@ class Footprint extends AbstractPartsContainingDBElement
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\FootprintAttachment")
* @ORM\JoinColumn(name="id_footprint_3d", referencedColumnName="id")
*/
protected $footprint_3d;
protected ?FootprintAttachment $footprint_3d = null;
/** @var Collection<int, FootprintParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\FootprintParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)

View file

@ -66,14 +66,14 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
* @ORM\Column(type="string", name="unit", nullable=true)
* @Assert\Length(max=10)
*/
protected $unit;
protected string $unit;
/**
* @var bool Determines if the amount value associated with this unit should be treated as integer.
* Set to false, to measure continuous sizes likes masses or lengths.
* @ORM\Column(type="boolean", name="is_integer")
*/
protected $is_integer = false;
protected bool $is_integer = false;
/**
* @var bool Determines if the unit can be used with SI Prefixes (kilo, giga, milli, etc.).
@ -81,7 +81,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
* @ORM\Column(type="boolean", name="use_si_prefix")
* @Assert\Expression("this.isUseSIPrefix() == false or this.getUnit() != null", message="validator.measurement_unit.use_si_prefix_needs_unit")
*/
protected $use_si_prefix = false;
protected bool $use_si_prefix = false;
/**
* @ORM\OneToMany(targetEntity="MeasurementUnit", mappedBy="parent", cascade={"persist"})

View file

@ -103,7 +103,7 @@ class Part extends AttachmentContainingDBElement
* @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"})
*/
protected $addedDate;
protected ?DateTime $addedDate = null;
/** *************************************************************
* Overridden properties
@ -115,7 +115,7 @@ class Part extends AttachmentContainingDBElement
* @ORM\Column(type="string")
* @ColumnSecurity(prefix="name")
*/
protected $name = '';
protected string $name = '';
/**
* @var Collection<int, PartAttachment>
@ -131,7 +131,7 @@ class Part extends AttachmentContainingDBElement
* @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"})
*/
protected $lastModified;
protected ?DateTime $lastModified = null;
/**
* @var Attachment
@ -139,7 +139,7 @@ class Part extends AttachmentContainingDBElement
* @ORM\JoinColumn(name="id_preview_attachement", referencedColumnName="id")
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture")
*/
protected $master_picture_attachment;
protected ?Attachment $master_picture_attachment = null;
public function __construct()
{

View file

@ -70,20 +70,20 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
* @var string A short description about this lot, shown in table
* @ORM\Column(type="text")
*/
protected $description = '';
protected string $description = '';
/**
* @var string a comment stored with this lot
* @ORM\Column(type="text")
*/
protected $comment = '';
protected string $comment = '';
/**
* @var ?DateTime Set a time until when the lot must be used.
* Set to null, if the lot can be used indefinitely.
* @ORM\Column(type="datetime", name="expiration_date", nullable=true)
*/
protected $expiration_date;
protected ?DateTime $expiration_date = null;
/**
* @var Storelocation|null The storelocation of this lot
@ -91,26 +91,26 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
* @ORM\JoinColumn(name="id_store_location", referencedColumnName="id", nullable=true)
* @Selectable()
*/
protected $storage_location;
protected ?Storelocation $storage_location = null;
/**
* @var bool If this is set to true, the instock amount is marked as not known
* @ORM\Column(type="boolean")
*/
protected $instock_unknown = false;
protected bool $instock_unknown = false;
/**
* @var float For continuous sizes (length, volume, etc.) the instock is saved here.
* @ORM\Column(type="float")
* @Assert\PositiveOrZero()
*/
protected $amount = 0;
protected float $amount = 0.0;
/**
* @var bool determines if this lot was manually marked for refilling
* @ORM\Column(type="boolean")
*/
protected $needs_refill = false;
protected bool $needs_refill = false;
/**
* @var Part The part that is stored in this lot
@ -118,7 +118,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
* @ORM\JoinColumn(name="id_part", referencedColumnName="id", nullable=false, onDelete="CASCADE")
* @Assert\NotNull()
*/
protected $part;
protected Part $part;
public function __clone()
{

View file

@ -57,14 +57,14 @@ trait AdvancedPropertyTrait
* @ORM\Column(type="boolean")
* @ColumnSecurity(type="boolean")
*/
protected $needs_review = false;
protected bool $needs_review = false;
/**
* @var string a comma separated list of tags, associated with the part
* @ORM\Column(type="text")
* @ColumnSecurity(type="string", prefix="tags", placeholder="")
*/
protected $tags = '';
protected string $tags = '';
/**
* @var float|null how much a single part unit weighs in grams
@ -72,7 +72,7 @@ trait AdvancedPropertyTrait
* @ColumnSecurity(type="float", placeholder=null)
* @Assert\PositiveOrZero()
*/
protected $mass;
protected ?float $mass = null;
/**
* Checks if this part is marked, for that it needs further review.

View file

@ -56,27 +56,27 @@ trait BasicPropertyTrait
* @ORM\Column(type="text")
* @ColumnSecurity(prefix="description")
*/
protected $description = '';
protected string $description = '';
/**
* @var string A comment/note related to this part
* @ORM\Column(type="text")
* @ColumnSecurity(prefix="comment")
*/
protected $comment = '';
protected string $comment = '';
/**
* @var bool Kept for compatibility (it is not used now, and I dont think it was used in old versions)
* @ORM\Column(type="boolean")
*/
protected $visible = true;
protected bool $visible = true;
/**
* @var bool true, if the part is marked as favorite
* @ORM\Column(type="boolean")
* @ColumnSecurity(type="boolean")
*/
protected $favorite = false;
protected bool $favorite = false;
/**
* @var Category The category this part belongs too (e.g. Resistors). Use tags, for more complex grouping.
@ -87,7 +87,7 @@ trait BasicPropertyTrait
* @Selectable()
* @Assert\NotNull(message="validator.select_valid_category")
*/
protected $category;
protected ?Category $category = null;
/**
* @var Footprint|null The footprint of this part (e.g. DIP8)
@ -96,7 +96,7 @@ trait BasicPropertyTrait
* @ColumnSecurity(prefix="footprint", type="App\Entity\Parts\Footprint")
* @Selectable()
*/
protected $footprint;
protected ?Footprint $footprint = null;
/**
* Get the description string like it is saved in the database.

View file

@ -70,7 +70,7 @@ trait InstockTrait
* @Assert\PositiveOrZero()
* @ColumnSecurity(prefix="minamount", type="integer")
*/
protected $minamount = 0;
protected float $minamount = 0;
/**
* @var ?MeasurementUnit the unit in which the part's amount is measured
@ -78,7 +78,7 @@ trait InstockTrait
* @ORM\JoinColumn(name="id_part_unit", referencedColumnName="id", nullable=true)
* @ColumnSecurity(type="object", prefix="unit")
*/
protected $partUnit;
protected ?MeasurementUnit $partUnit = null;
/**
* Get all part lots where this part is stored.

View file

@ -61,7 +61,7 @@ trait ManufacturerTrait
* @ColumnSecurity(prefix="manufacturer", type="App\Entity\Parts\Manufacturer")
* @Selectable()
*/
protected $manufacturer;
protected ?Manufacturer $manufacturer = null;
/**
* @var string the url to the part on the manufacturer's homepage
@ -69,14 +69,14 @@ trait ManufacturerTrait
* @Assert\Url()
* @ColumnSecurity(prefix="mpn", type="string", placeholder="")
*/
protected $manufacturer_product_url = '';
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")
* @ColumnSecurity(prefix="mpn", type="string", placeholder="")
*/
protected $manufacturer_product_number = '';
protected string $manufacturer_product_number = '';
/**
* @var string The production status of this part. Can be one of the specified ones.
@ -84,7 +84,7 @@ trait ManufacturerTrait
* @Assert\Choice({"announced", "active", "nrfnd", "eol", "discontinued", ""})
* @ColumnSecurity(type="string", prefix="status", placeholder="")
*/
protected $manufacturing_status = '';
protected string $manufacturing_status = '';
/**
* Get the link to the website of the article on the manufacturers website

Some files were not shown because too many files have changed in this diff Show more