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 static $defaultName = 'partdb:attachments:clean-unused|app:clean-attachments';
protected $attachment_helper; protected AttachmentManager $attachment_helper;
protected $reverseSearch; protected AttachmentReverseSearch $reverseSearch;
protected $mimeTypeGuesser; protected MimeTypes $mimeTypeGuesser;
protected $pathResolver; protected AttachmentPathResolver $pathResolver;
public function __construct(AttachmentManager $attachmentHelper, AttachmentReverseSearch $reverseSearch, 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 static $defaultName = 'partdb:check-requirements';
protected $params; protected ContainerBagInterface $params;
public function __construct(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 static $defaultName = 'partdb:currencies:update-exchange-rates|partdb:update-exchange-rates|app:update-exchange-rates';
protected $base_current; protected string $base_current;
protected $em; protected EntityManagerInterface $em;
protected $exchangeRateUpdater; protected ExchangeRateUpdater $exchangeRateUpdater;
public function __construct(string $base_current, EntityManagerInterface $entityManager, 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\Base\AbstractNamedDBElement;
use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\LogSystem\AbstractLogEntry;
use App\Repository\LogEntryRepository;
use App\Services\ElementTypeNameGenerator; use App\Services\ElementTypeNameGenerator;
use App\Services\LogSystem\LogEntryExtraFormatter; use App\Services\LogSystem\LogEntryExtraFormatter;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -58,11 +59,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ShowEventLogCommand extends Command class ShowEventLogCommand extends Command
{ {
protected static $defaultName = 'partdb:logs:show|app:show-logs'; protected static $defaultName = 'partdb:logs:show|app:show-logs';
protected $entityManager; protected EntityManagerInterface $entityManager;
protected $translator; protected TranslatorInterface $translator;
protected $elementTypeNameGenerator; protected ElementTypeNameGenerator $elementTypeNameGenerator;
protected $repo; protected LogEntryRepository $repo;
protected $formatter; protected LogEntryExtraFormatter $formatter;
public function __construct(EntityManagerInterface $entityManager, public function __construct(EntityManagerInterface $entityManager,
TranslatorInterface $translator, ElementTypeNameGenerator $elementTypeNameGenerator, LogEntryExtraFormatter $formatter) 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 static $defaultName = 'partdb:migrations:convert-bbcode|app:convert-bbcode';
protected $em; protected EntityManagerInterface $em;
protected $propertyAccessor; protected PropertyAccessorInterface $propertyAccessor;
protected $converter; protected BBCodeToMarkdownConverter $converter;
public function __construct(EntityManagerInterface $entityManager, PropertyAccessorInterface $propertyAccessor) 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 static $defaultName = 'partdb:users:set-password|app:set-password|users:set-password';
protected $entityManager; protected EntityManagerInterface $entityManager;
protected $encoder; protected UserPasswordHasherInterface $encoder;
protected $eventDispatcher; protected EventDispatcherInterface $eventDispatcher;
public function __construct(EntityManagerInterface $entityManager, UserPasswordHasherInterface $passwordEncoder, 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 static $defaultName = 'partdb:users:list|users:list';
protected $entityManager; protected EntityManagerInterface $entityManager;
public function __construct(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 static $defaultName = 'partdb:version|app:version';
protected $versionManager; protected VersionManagerInterface $versionManager;
protected $gitVersionInfo; protected GitVersionInfo $gitVersionInfo;
public function __construct(VersionManagerInterface $versionManager, GitVersionInfo $gitVersionInfo) public function __construct(VersionManagerInterface $versionManager, GitVersionInfo $gitVersionInfo)
{ {
@ -43,7 +43,7 @@ class VersionCommand extends Command
$io->success($message); $io->success($message);
$io->info('PHP version: '. phpversion()); $io->info('PHP version: '.PHP_VERSION);
$io->info('Symfony version: ' . $this->getApplication()->getVersion()); $io->info('Symfony version: ' . $this->getApplication()->getVersion());
$io->info('OS: '. php_uname()); $io->info('OS: '. php_uname());
$io->info('PHP extension: '. implode(', ', get_loaded_extensions())); $io->info('PHP extension: '. implode(', ', get_loaded_extensions()));

View file

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

View file

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

View file

@ -55,9 +55,9 @@ use Symfony\Contracts\Cache\CacheInterface;
class HomepageController extends AbstractController class HomepageController extends AbstractController
{ {
protected $cache; protected CacheInterface $cache;
protected $kernel; protected KernelInterface $kernel;
protected $dataTable; protected DataTableFactory $dataTable;
public function __construct(CacheInterface $cache, KernelInterface $kernel, 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 class LabelController extends AbstractController
{ {
protected $labelGenerator; protected LabelGenerator $labelGenerator;
protected $em; protected EntityManagerInterface $em;
protected $elementTypeNameGenerator; protected ElementTypeNameGenerator $elementTypeNameGenerator;
protected $rangeParser; protected RangeParser $rangeParser;
protected $translator; protected TranslatorInterface $translator;
public function __construct(LabelGenerator $labelGenerator, EntityManagerInterface $em, ElementTypeNameGenerator $elementTypeNameGenerator, public function __construct(LabelGenerator $labelGenerator, EntityManagerInterface $em, ElementTypeNameGenerator $elementTypeNameGenerator,
RangeParser $rangeParser, TranslatorInterface $translator) RangeParser $rangeParser, TranslatorInterface $translator)

View file

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

View file

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

View file

@ -64,9 +64,9 @@ use Symfony\Component\Routing\Annotation\Route;
class PartListsController extends AbstractController class PartListsController extends AbstractController
{ {
private $entityManager; private EntityManagerInterface $entityManager;
private $nodesListBuilder; private NodesListBuilder $nodesListBuilder;
private $dataTableFactory; private DataTableFactory $dataTableFactory;
public function __construct(EntityManagerInterface $entityManager, NodesListBuilder $nodesListBuilder, 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 class RedirectController extends AbstractController
{ {
protected $default_locale; protected string $default_locale;
protected $translator; protected TranslatorInterface $translator;
protected $session; protected SessionInterface $session;
protected $enforce_index_php; protected bool $enforce_index_php;
public function __construct(string $default_locale, TranslatorInterface $translator, SessionInterface $session, 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 class ScanController extends AbstractController
{ {
protected $barcodeParser; protected BarcodeRedirector $barcodeParser;
protected $barcodeNormalizer; protected BarcodeNormalizer $barcodeNormalizer;
public function __construct(BarcodeRedirector $barcodeParser, BarcodeNormalizer $barcodeNormalizer) public function __construct(BarcodeRedirector $barcodeParser, BarcodeNormalizer $barcodeNormalizer)
{ {

View file

@ -68,8 +68,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class SecurityController extends AbstractController class SecurityController extends AbstractController
{ {
protected $translator; protected TranslatorInterface $translator;
protected $allow_email_pw_reset; protected bool $allow_email_pw_reset;
public function __construct(TranslatorInterface $translator, 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 class SelectAPIController extends AbstractController
{ {
private $nodesListBuilder; private NodesListBuilder $nodesListBuilder;
private $translator; private TranslatorInterface $translator;
public function __construct(NodesListBuilder $nodesListBuilder, 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 class TreeController extends AbstractController
{ {
protected $treeGenerator; protected TreeViewGenerator $treeGenerator;
public function __construct(TreeViewGenerator $treeGenerator) public function __construct(TreeViewGenerator $treeGenerator)
{ {

View file

@ -74,8 +74,8 @@ use Symfony\Component\Serializer\Serializer;
*/ */
class TypeaheadController extends AbstractController class TypeaheadController extends AbstractController
{ {
protected $urlGenerator; protected AttachmentURLGenerator $urlGenerator;
protected $assets; protected Packages $assets;
public function __construct(AttachmentURLGenerator $URLGenerator, 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 class UserSettingsController extends AbstractController
{ {
protected $demo_mode; protected bool $demo_mode;
/** /**
* @var EventDispatcher|EventDispatcherInterface * @var EventDispatcher|EventDispatcherInterface
*/ */

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -48,8 +48,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class LogEntryExtraColumn extends AbstractColumn class LogEntryExtraColumn extends AbstractColumn
{ {
protected $translator; protected TranslatorInterface $translator;
protected $formatter; protected LogEntryExtraFormatter $formatter;
public function __construct(TranslatorInterface $translator, 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\Orderdetail;
use App\Entity\PriceInformations\Pricedetail; use App\Entity\PriceInformations\Pricedetail;
use App\Exceptions\EntityNotSupportedException; use App\Exceptions\EntityNotSupportedException;
use App\Repository\LogEntryRepository;
use App\Services\ElementTypeNameGenerator; use App\Services\ElementTypeNameGenerator;
use App\Services\EntityURLGenerator; use App\Services\EntityURLGenerator;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -61,11 +62,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class LogEntryTargetColumn extends AbstractColumn class LogEntryTargetColumn extends AbstractColumn
{ {
protected $em; protected EntityManagerInterface $em;
protected $entryRepository; protected LogEntryRepository $entryRepository;
protected $entityURLGenerator; protected EntityURLGenerator $entityURLGenerator;
protected $elementTypeNameGenerator; protected ElementTypeNameGenerator $elementTypeNameGenerator;
protected $translator; protected TranslatorInterface $translator;
public function __construct(EntityManagerInterface $entityManager, EntityURLGenerator $entityURLGenerator, public function __construct(EntityManagerInterface $entityManager, EntityURLGenerator $entityURLGenerator,
ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator) ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator)

View file

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

View file

@ -53,9 +53,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class PartAttachmentsColumn extends AbstractColumn class PartAttachmentsColumn extends AbstractColumn
{ {
protected $FAIconGenerator; protected FAIconGenerator $FAIconGenerator;
protected $urlGenerator; protected EntityURLGenerator $urlGenerator;
protected $attachmentManager; protected AttachmentManager $attachmentManager;
public function __construct(FAIconGenerator $FAIconGenerator, EntityURLGenerator $urlGenerator, 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 class PrettyBoolColumn extends AbstractColumn
{ {
protected TranslatorInterface $translator;
protected $translator;
public function __construct(TranslatorInterface $translator) public function __construct(TranslatorInterface $translator)
{ {

View file

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

View file

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

View file

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

View file

@ -17,26 +17,13 @@ class AttachmentFilter implements FilterInterface
{ {
use CompoundFilterTrait; use CompoundFilterTrait;
/** @var NumberConstraint */ protected NumberConstraint $dbId;
protected $dbId; protected InstanceOfConstraint $targetType;
protected TextConstraint $name;
/** @var InstanceOfConstraint */ protected EntityConstraint $attachmentType;
protected $targetType; protected BooleanConstraint $showInTable;
protected DateTimeConstraint $lastModified;
/** @var TextConstraint */ protected DateTimeConstraint $addedDate;
protected $name;
/** @var EntityConstraint */
protected $attachmentType;
/** @var BooleanConstraint */
protected $showInTable;
/** @var DateTimeConstraint */
protected $lastModified;
/** @var DateTimeConstraint */
protected $addedDate;
public function __construct(NodesListBuilder $nodesListBuilder) 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 * @var string The property where this BooleanConstraint should apply to
*/ */
protected $property; protected string $property;
/** /**
* @var string * @var string
*/ */
protected $identifier; protected string $identifier;
/** /**

View file

@ -8,7 +8,7 @@ use Doctrine\ORM\QueryBuilder;
class BooleanConstraint extends AbstractConstraint class BooleanConstraint extends AbstractConstraint
{ {
/** @var bool|null The value of our constraint */ /** @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) 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 * @var string[]|int[] The values to compare to
*/ */
protected $value; protected array $value;
/** /**
* @var string The operator to use * @var string The operator to use
*/ */
protected $operator; protected string $operator;
/** /**
* @return string[]|int[] * @return string[]|int[]

View file

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

View file

@ -8,7 +8,7 @@ use Doctrine\ORM\QueryBuilder;
trait FilterTrait trait FilterTrait
{ {
protected $useHaving = false; protected bool $useHaving = false;
public function useHaving($value = true): self 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) * @var string[] The values to compare to (fully qualified class names)
*/ */
protected $value; protected array $value;
/** /**
* @var string The operator to use * @var string The operator to use
*/ */
protected $operator; protected string $operator;
/** /**
* @return string[] * @return string[]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -9,43 +9,43 @@ class PartSearchFilter implements FilterInterface
{ {
/** @var string The string to query for */ /** @var string The string to query for */
protected $keyword; protected string $keyword;
/** @var boolean Whether to use regex for searching */ /** @var boolean Whether to use regex for searching */
protected $regex = false; protected bool $regex = false;
/** @var bool Use name field for searching */ /** @var bool Use name field for searching */
protected $name = true; protected bool $name = true;
/** @var bool Use category name for searching */ /** @var bool Use category name for searching */
protected $category = true; protected bool $category = true;
/** @var bool Use description for searching */ /** @var bool Use description for searching */
protected $description = true; protected bool $description = true;
/** @var bool Use tags for searching */ /** @var bool Use tags for searching */
protected $tags = true; protected bool $tags = true;
/** @var bool Use storelocation name for searching */ /** @var bool Use storelocation name for searching */
protected $storelocation = true; protected bool $storelocation = true;
/** @var bool Use comment field for searching */ /** @var bool Use comment field for searching */
protected $comment = true; protected bool $comment = true;
/** @var bool Use ordernr for searching */ /** @var bool Use ordernr for searching */
protected $ordernr = true; protected bool $ordernr = true;
/** @var bool Use manufacturer product name for searching */ /** @var bool Use manufacturer product name for searching */
protected $mpn = true; protected bool $mpn = true;
/** @var bool Use supplier name for searching */ /** @var bool Use supplier name for searching */
protected $supplier = false; protected bool $supplier = false;
/** @var bool Use manufacturer name for searching */ /** @var bool Use manufacturer name for searching */
protected $manufacturer = false; protected bool $manufacturer = false;
/** @var bool Use footprint name for searching */ /** @var bool Use footprint name for searching */
protected $footprint = false; protected bool $footprint = false;
public function __construct(string $query) 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\Group;
use App\Entity\UserSystem\User; use App\Entity\UserSystem\User;
use App\Exceptions\EntityNotSupportedException; use App\Exceptions\EntityNotSupportedException;
use App\Repository\LogEntryRepository;
use App\Services\ElementTypeNameGenerator; use App\Services\ElementTypeNameGenerator;
use App\Services\EntityURLGenerator; use App\Services\EntityURLGenerator;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -77,12 +78,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class LogDataTable implements DataTableTypeInterface class LogDataTable implements DataTableTypeInterface
{ {
protected $elementTypeNameGenerator; protected ElementTypeNameGenerator $elementTypeNameGenerator;
protected $translator; protected TranslatorInterface $translator;
protected $urlGenerator; protected UrlGeneratorInterface $urlGenerator;
protected $entityURLGenerator; protected EntityURLGenerator $entityURLGenerator;
protected $logRepo; protected LogEntryRepository $logRepo;
protected $security; protected Security $security;
public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator, public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, TranslatorInterface $translator,
UrlGeneratorInterface $urlGenerator, EntityURLGenerator $entityURLGenerator, EntityManagerInterface $entityManager, Security $security) UrlGeneratorInterface $urlGenerator, EntityURLGenerator $entityURLGenerator, EntityManagerInterface $entityManager, Security $security)

View file

@ -79,12 +79,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final class PartsDataTable implements DataTableTypeInterface final class PartsDataTable implements DataTableTypeInterface
{ {
private $translator; private TranslatorInterface $translator;
private $treeBuilder; private NodesListBuilder $treeBuilder;
private $amountFormatter; private AmountFormatter $amountFormatter;
private $previewGenerator; private PartPreviewGenerator $previewGenerator;
private $attachmentURLGenerator; private AttachmentURLGenerator $attachmentURLGenerator;
private $security; private Security $security;
/** /**
* @var EntityURLGenerator * @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 * @var string|null the original filename the file had, when the user uploaded it
* @ORM\Column(type="string", nullable=true) * @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% * @var string The path to the file relative to a placeholder path like %MEDIA%
* @ORM\Column(type="string", name="path") * @ORM\Column(type="string", name="path")
*/ */
protected $path = ''; protected string $path = '';
/** /**
* ORM mapping is done in sub classes (like PartAttachment). * ORM mapping is done in sub classes (like PartAttachment).
*/ */
protected $element; protected ?AttachmentContainingDBElement $element = null;
/** /**
* @var bool * @var bool
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $show_in_table = false; protected bool $show_in_table = false;
/** /**
* @var AttachmentType * @var AttachmentType
@ -108,7 +108,7 @@ abstract class Attachment extends AbstractNamedDBElement
* @Selectable() * @Selectable()
* @Assert\NotNull(message="validator.attachment.must_not_be_null") * @Assert\NotNull(message="validator.attachment.must_not_be_null")
*/ */
protected $attachment_type; protected ?AttachmentType $attachment_type = null;
public function __construct() public function __construct()
{ {

View file

@ -55,7 +55,7 @@ class AttachmentType extends AbstractStructuralDBElement
* @ORM\Column(type="text") * @ORM\Column(type="text")
* @ValidFileFilter * @ValidFileFilter
*/ */
protected $filetype_filter = ''; protected string $filetype_filter = '';
/** /**
* @var Collection<int, AttachmentTypeAttachment> * @var Collection<int, AttachmentTypeAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @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\ManyToOne(targetEntity="App\Entity\Attachments\AttachmentType", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\Parts\Category", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\PriceInformations\Currency", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\Devices\Device", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\Parts\Footprint", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\UserSystem\Group", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\LabelSystem\LabelProfile", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\Parts\Manufacturer", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\Parts\MeasurementUnit", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\Parts\Storelocation", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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\ManyToOne(targetEntity="App\Entity\UserSystem\User", inversedBy="attachments")
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). * @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 * @var string The address of the company
* @ORM\Column(type="string") * @ORM\Column(type="string")
*/ */
protected $address = ''; protected string $address = '';
/** /**
* @var string The phone number of the company * @var string The phone number of the company
* @ORM\Column(type="string") * @ORM\Column(type="string")
*/ */
protected $phone_number = ''; protected string $phone_number = '';
/** /**
* @var string The fax number of the company * @var string The fax number of the company
* @ORM\Column(type="string") * @ORM\Column(type="string")
*/ */
protected $fax_number = ''; protected string $fax_number = '';
/** /**
* @var string The email address of the company * @var string The email address of the company
* @ORM\Column(type="string") * @ORM\Column(type="string")
* @Assert\Email() * @Assert\Email()
*/ */
protected $email_address = ''; protected string $email_address = '';
/** /**
* @var string The website of the company * @var string The website of the company
* @ORM\Column(type="string") * @ORM\Column(type="string")
* @Assert\Url() * @Assert\Url()
*/ */
protected $website = ''; protected string $website = '';
/** /**
* @var string * @var string
* @ORM\Column(type="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() * @ORM\GeneratedValue()
* @Groups({"full"}) * @Groups({"full"})
*/ */
protected $id; protected ?int $id = null;
public function __clone() public function __clone()
{ {

View file

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

View file

@ -65,19 +65,19 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
* @ORM\Column(type="text") * @ORM\Column(type="text")
* @Groups({"simple", "extended", "full"}) * @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. * @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. * Useful if this element should be used only for grouping, sorting.
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $not_selectable = false; protected bool $not_selectable = false;
/** /**
* @var int * @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 * 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, /** @var string[] all names of all parent elements as a array of strings,
* the last array element is the name of the element itself * the last array element is the name of the element itself
*/ */
private $full_path_strings = []; private array $full_path_strings = [];
public function __construct() public function __construct()
{ {

View file

@ -57,7 +57,7 @@ trait MasterAttachmentTrait
* @ORM\JoinColumn(name="id_preview_attachement", referencedColumnName="id") * @ORM\JoinColumn(name="id_preview_attachement", referencedColumnName="id")
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture") * @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). * 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"}) * @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"})
* @Groups({"extended", "full"}) * @Groups({"extended", "full"})
*/ */
protected $lastModified; protected ?DateTime $lastModified = null;
/** /**
* @var DateTime|null the date when this element was created * @var DateTime|null the date when this element was created
* @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"}) * @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"})
* @Groups({"extended", "full"}) * @Groups({"extended", "full"})
*/ */
protected $addedDate; protected ?DateTime $addedDate = null;
/** /**
* Returns the last time when the element was modified. * Returns the last time when the element was modified.

View file

@ -84,16 +84,14 @@ class Device extends AbstractPartsContainingDBElement
protected $parts; protected $parts;
/** /**
* @var int
* @ORM\Column(type="integer") * @ORM\Column(type="integer")
*/ */
protected $order_quantity = 0; protected int $order_quantity = 0;
/** /**
* @var bool
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $order_only_missing_parts = false; protected bool $order_only_missing_parts = false;
/** /**
* @var Collection<int, DeviceAttachment> * @var Collection<int, DeviceAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\DeviceAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @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 * @var int
* @ORM\Column(type="integer", name="quantity") * @ORM\Column(type="integer", name="quantity")
*/ */
protected $quantity; protected int $quantity;
/** /**
* @var string * @var string
* @ORM\Column(type="text", name="mountnames") * @ORM\Column(type="text", name="mountnames")
*/ */
protected $mountnames; protected string $mountnames;
/** /**
* @var Device * @var Device
* @ORM\ManyToOne(targetEntity="Device", inversedBy="parts") * @ORM\ManyToOne(targetEntity="Device", inversedBy="parts")
* @ORM\JoinColumn(name="id_device", referencedColumnName="id") * @ORM\JoinColumn(name="id_device", referencedColumnName="id")
*/ */
protected $device; protected Device $device;
/** /**
* @var Part * @var Part
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part") * @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part")
* @ORM\JoinColumn(name="id_part", referencedColumnName="id") * @ORM\JoinColumn(name="id_part", referencedColumnName="id")
*/ */
protected $part; protected Part $part;
} }

View file

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

View file

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

View file

@ -161,33 +161,33 @@ abstract class AbstractLogEntry extends AbstractDBElement
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", fetch="EAGER") * @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", fetch="EAGER")
* @ORM\JoinColumn(name="id_user", nullable=false) * @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 /** @var DateTime The datetime the event associated with this log entry has occured
* @ORM\Column(type="datetime", name="datetime") * @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 /** @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") * @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 /** @var int The ID of the element targeted by this event
* @ORM\Column(name="target_id", type="integer", nullable=false) * @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 /** @var int The Type of the targeted element
* @ORM\Column(name="target_type", type="smallint", nullable=false) * @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. /** @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. * 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. * 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 /** @var array The extra data in raw (short form) saved in the DB
* @ORM\Column(name="extra", type="json") * @ORM\Column(name="extra", type="json")

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -54,49 +54,49 @@ class Category extends AbstractPartsContainingDBElement
* @var string * @var string
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
protected $partname_hint = ''; protected string $partname_hint = '';
/** /**
* @var string * @var string
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
protected $partname_regex = ''; protected string $partname_regex = '';
/** /**
* @var bool * @var bool
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $disable_footprints = false; protected bool $disable_footprints = false;
/** /**
* @var bool * @var bool
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $disable_manufacturers = false; protected bool $disable_manufacturers = false;
/** /**
* @var bool * @var bool
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $disable_autodatasheets = false; protected bool $disable_autodatasheets = false;
/** /**
* @var bool * @var bool
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $disable_properties = false; protected bool $disable_properties = false;
/** /**
* @var string * @var string
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
protected $default_description = ''; protected string $default_description = '';
/** /**
* @var string * @var string
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
protected $default_comment = ''; protected string $default_comment = '';
/** /**
* @var Collection<int, CategoryAttachment> * @var Collection<int, CategoryAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\CategoryAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @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\ManyToOne(targetEntity="App\Entity\Attachments\FootprintAttachment")
* @ORM\JoinColumn(name="id_footprint_3d", referencedColumnName="id") * @ORM\JoinColumn(name="id_footprint_3d", referencedColumnName="id")
*/ */
protected $footprint_3d; protected ?FootprintAttachment $footprint_3d = null;
/** @var Collection<int, FootprintParameter> /** @var Collection<int, FootprintParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\FootprintParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @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) * @ORM\Column(type="string", name="unit", nullable=true)
* @Assert\Length(max=10) * @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. * @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. * Set to false, to measure continuous sizes likes masses or lengths.
* @ORM\Column(type="boolean", name="is_integer") * @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.). * @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") * @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") * @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"}) * @ORM\OneToMany(targetEntity="MeasurementUnit", mappedBy="parent", cascade={"persist"})

View file

@ -103,7 +103,7 @@ class Part extends AttachmentContainingDBElement
* @ColumnSecurity(type="datetime") * @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"}) * @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"})
*/ */
protected $addedDate; protected ?DateTime $addedDate = null;
/** ************************************************************* /** *************************************************************
* Overridden properties * Overridden properties
@ -115,7 +115,7 @@ class Part extends AttachmentContainingDBElement
* @ORM\Column(type="string") * @ORM\Column(type="string")
* @ColumnSecurity(prefix="name") * @ColumnSecurity(prefix="name")
*/ */
protected $name = ''; protected string $name = '';
/** /**
* @var Collection<int, PartAttachment> * @var Collection<int, PartAttachment>
@ -131,7 +131,7 @@ class Part extends AttachmentContainingDBElement
* @ColumnSecurity(type="datetime") * @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"}) * @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"})
*/ */
protected $lastModified; protected ?DateTime $lastModified = null;
/** /**
* @var Attachment * @var Attachment
@ -139,7 +139,7 @@ class Part extends AttachmentContainingDBElement
* @ORM\JoinColumn(name="id_preview_attachement", referencedColumnName="id") * @ORM\JoinColumn(name="id_preview_attachement", referencedColumnName="id")
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture") * @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() 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 * @var string A short description about this lot, shown in table
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
protected $description = ''; protected string $description = '';
/** /**
* @var string a comment stored with this lot * @var string a comment stored with this lot
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
protected $comment = ''; protected string $comment = '';
/** /**
* @var ?DateTime Set a time until when the lot must be used. * @var ?DateTime Set a time until when the lot must be used.
* Set to null, if the lot can be used indefinitely. * Set to null, if the lot can be used indefinitely.
* @ORM\Column(type="datetime", name="expiration_date", nullable=true) * @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 * @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) * @ORM\JoinColumn(name="id_store_location", referencedColumnName="id", nullable=true)
* @Selectable() * @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 * @var bool If this is set to true, the instock amount is marked as not known
* @ORM\Column(type="boolean") * @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. * @var float For continuous sizes (length, volume, etc.) the instock is saved here.
* @ORM\Column(type="float") * @ORM\Column(type="float")
* @Assert\PositiveOrZero() * @Assert\PositiveOrZero()
*/ */
protected $amount = 0; protected float $amount = 0.0;
/** /**
* @var bool determines if this lot was manually marked for refilling * @var bool determines if this lot was manually marked for refilling
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $needs_refill = false; protected bool $needs_refill = false;
/** /**
* @var Part The part that is stored in this lot * @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") * @ORM\JoinColumn(name="id_part", referencedColumnName="id", nullable=false, onDelete="CASCADE")
* @Assert\NotNull() * @Assert\NotNull()
*/ */
protected $part; protected Part $part;
public function __clone() public function __clone()
{ {

View file

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

View file

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

View file

@ -70,7 +70,7 @@ trait InstockTrait
* @Assert\PositiveOrZero() * @Assert\PositiveOrZero()
* @ColumnSecurity(prefix="minamount", type="integer") * @ColumnSecurity(prefix="minamount", type="integer")
*/ */
protected $minamount = 0; protected float $minamount = 0;
/** /**
* @var ?MeasurementUnit the unit in which the part's amount is measured * @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) * @ORM\JoinColumn(name="id_part_unit", referencedColumnName="id", nullable=true)
* @ColumnSecurity(type="object", prefix="unit") * @ColumnSecurity(type="object", prefix="unit")
*/ */
protected $partUnit; protected ?MeasurementUnit $partUnit = null;
/** /**
* Get all part lots where this part is stored. * 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") * @ColumnSecurity(prefix="manufacturer", type="App\Entity\Parts\Manufacturer")
* @Selectable() * @Selectable()
*/ */
protected $manufacturer; protected ?Manufacturer $manufacturer = null;
/** /**
* @var string the url to the part on the manufacturer's homepage * @var string the url to the part on the manufacturer's homepage
@ -69,14 +69,14 @@ trait ManufacturerTrait
* @Assert\Url() * @Assert\Url()
* @ColumnSecurity(prefix="mpn", type="string", placeholder="") * @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. * @var string The product number used by the manufacturer. If this is set to "", the name field is used.
* @ORM\Column(type="string") * @ORM\Column(type="string")
* @ColumnSecurity(prefix="mpn", type="string", placeholder="") * @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. * @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", ""}) * @Assert\Choice({"announced", "active", "nrfnd", "eol", "discontinued", ""})
* @ColumnSecurity(type="string", prefix="status", placeholder="") * @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 * 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