diff --git a/src/Command/Attachments/CleanAttachmentsCommand.php b/src/Command/Attachments/CleanAttachmentsCommand.php index 465fe1a7..4cf81375 100644 --- a/src/Command/Attachments/CleanAttachmentsCommand.php +++ b/src/Command/Attachments/CleanAttachmentsCommand.php @@ -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) { diff --git a/src/Command/CheckRequirementsCommand.php b/src/Command/CheckRequirementsCommand.php index 49b7980b..1aea3543 100644 --- a/src/Command/CheckRequirementsCommand.php +++ b/src/Command/CheckRequirementsCommand.php @@ -13,7 +13,7 @@ class CheckRequirementsCommand extends Command { protected static $defaultName = 'partdb:check-requirements'; - protected $params; + protected ContainerBagInterface $params; public function __construct(ContainerBagInterface $params) { diff --git a/src/Command/Currencies/UpdateExchangeRatesCommand.php b/src/Command/Currencies/UpdateExchangeRatesCommand.php index 7c86bd12..f45b0c57 100644 --- a/src/Command/Currencies/UpdateExchangeRatesCommand.php +++ b/src/Command/Currencies/UpdateExchangeRatesCommand.php @@ -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) { diff --git a/src/Command/Logs/ShowEventLogCommand.php b/src/Command/Logs/ShowEventLogCommand.php index 7da5a6b7..159c3de8 100644 --- a/src/Command/Logs/ShowEventLogCommand.php +++ b/src/Command/Logs/ShowEventLogCommand.php @@ -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) diff --git a/src/Command/Migrations/ConvertBBCodeCommand.php b/src/Command/Migrations/ConvertBBCodeCommand.php index 16ab7b5f..23b7622f 100644 --- a/src/Command/Migrations/ConvertBBCodeCommand.php +++ b/src/Command/Migrations/ConvertBBCodeCommand.php @@ -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) { diff --git a/src/Command/User/SetPasswordCommand.php b/src/Command/User/SetPasswordCommand.php index 7911e050..f36a2b24 100644 --- a/src/Command/User/SetPasswordCommand.php +++ b/src/Command/User/SetPasswordCommand.php @@ -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) { diff --git a/src/Command/User/UserListCommand.php b/src/Command/User/UserListCommand.php index 08289e9c..61d6a6d6 100644 --- a/src/Command/User/UserListCommand.php +++ b/src/Command/User/UserListCommand.php @@ -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) { diff --git a/src/Command/VersionCommand.php b/src/Command/VersionCommand.php index 1be7ea3a..211d0563 100644 --- a/src/Command/VersionCommand.php +++ b/src/Command/VersionCommand.php @@ -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())); diff --git a/src/Controller/AdminPages/BaseAdminController.php b/src/Controller/AdminPages/BaseAdminController.php index fe900c5f..dbbf9037 100644 --- a/src/Controller/AdminPages/BaseAdminController.php +++ b/src/Controller/AdminPages/BaseAdminController.php @@ -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, diff --git a/src/Controller/AdminPages/CurrencyController.php b/src/Controller/AdminPages/CurrencyController.php index 169b451f..4e83ba04 100644 --- a/src/Controller/AdminPages/CurrencyController.php +++ b/src/Controller/AdminPages/CurrencyController.php @@ -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, diff --git a/src/Controller/HomepageController.php b/src/Controller/HomepageController.php index b9126867..e097111a 100644 --- a/src/Controller/HomepageController.php +++ b/src/Controller/HomepageController.php @@ -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) { diff --git a/src/Controller/LabelController.php b/src/Controller/LabelController.php index 920233c7..ad333e19 100644 --- a/src/Controller/LabelController.php +++ b/src/Controller/LabelController.php @@ -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) diff --git a/src/Controller/LogController.php b/src/Controller/LogController.php index c4c81df8..c222ab9c 100644 --- a/src/Controller/LogController.php +++ b/src/Controller/LogController.php @@ -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) { diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php index 19c16662..da9f245a 100644 --- a/src/Controller/PartController.php +++ b/src/Controller/PartController.php @@ -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) diff --git a/src/Controller/PartListsController.php b/src/Controller/PartListsController.php index 3c883551..7defc282 100644 --- a/src/Controller/PartListsController.php +++ b/src/Controller/PartListsController.php @@ -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) { diff --git a/src/Controller/RedirectController.php b/src/Controller/RedirectController.php index 72cc3477..9be5be60 100644 --- a/src/Controller/RedirectController.php +++ b/src/Controller/RedirectController.php @@ -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) { diff --git a/src/Controller/ScanController.php b/src/Controller/ScanController.php index 685c91ff..3b1aae74 100644 --- a/src/Controller/ScanController.php +++ b/src/Controller/ScanController.php @@ -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) { diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index e304072f..9c77c442 100644 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -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) { diff --git a/src/Controller/SelectAPIController.php b/src/Controller/SelectAPIController.php index f1899d47..b84789f0 100644 --- a/src/Controller/SelectAPIController.php +++ b/src/Controller/SelectAPIController.php @@ -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) { diff --git a/src/Controller/TreeController.php b/src/Controller/TreeController.php index af4546f4..4c72ac8a 100644 --- a/src/Controller/TreeController.php +++ b/src/Controller/TreeController.php @@ -61,7 +61,7 @@ use Symfony\Component\Routing\Annotation\Route; */ class TreeController extends AbstractController { - protected $treeGenerator; + protected TreeViewGenerator $treeGenerator; public function __construct(TreeViewGenerator $treeGenerator) { diff --git a/src/Controller/TypeaheadController.php b/src/Controller/TypeaheadController.php index 77edae80..92571df9 100644 --- a/src/Controller/TypeaheadController.php +++ b/src/Controller/TypeaheadController.php @@ -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) { diff --git a/src/Controller/UserSettingsController.php b/src/Controller/UserSettingsController.php index a6e65a7b..0fa35881 100644 --- a/src/Controller/UserSettingsController.php +++ b/src/Controller/UserSettingsController.php @@ -73,7 +73,8 @@ use Symfony\Component\Validator\Constraints\Length; */ class UserSettingsController extends AbstractController { - protected $demo_mode; + protected bool $demo_mode; + /** * @var EventDispatcher|EventDispatcherInterface */ diff --git a/src/DataFixtures/DataStructureFixtures.php b/src/DataFixtures/DataStructureFixtures.php index 3e25e57a..89d634b0 100644 --- a/src/DataFixtures/DataStructureFixtures.php +++ b/src/DataFixtures/DataStructureFixtures.php @@ -58,7 +58,7 @@ use InvalidArgumentException; class DataStructureFixtures extends Fixture { - protected $em; + protected EntityManagerInterface $em; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/DataFixtures/LabelProfileFixtures.php b/src/DataFixtures/LabelProfileFixtures.php index 6d725fe8..71e8f88e 100644 --- a/src/DataFixtures/LabelProfileFixtures.php +++ b/src/DataFixtures/LabelProfileFixtures.php @@ -31,7 +31,7 @@ use Doctrine\Persistence\ObjectManager; class LabelProfileFixtures extends Fixture { - protected $em; + protected EntityManagerInterface $em; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/DataFixtures/PartFixtures.php b/src/DataFixtures/PartFixtures.php index fb5821fe..6b9dcd9f 100644 --- a/src/DataFixtures/PartFixtures.php +++ b/src/DataFixtures/PartFixtures.php @@ -42,7 +42,7 @@ use Doctrine\Persistence\ObjectManager; class PartFixtures extends Fixture { - protected $em; + protected EntityManagerInterface $em; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/DataFixtures/UserFixtures.php b/src/DataFixtures/UserFixtures.php index 8251ba93..67a4de10 100644 --- a/src/DataFixtures/UserFixtures.php +++ b/src/DataFixtures/UserFixtures.php @@ -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) { diff --git a/src/DataTables/AttachmentDataTable.php b/src/DataTables/AttachmentDataTable.php index 122d3abe..1ac542f7 100644 --- a/src/DataTables/AttachmentDataTable.php +++ b/src/DataTables/AttachmentDataTable.php @@ -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, diff --git a/src/DataTables/Column/EntityColumn.php b/src/DataTables/Column/EntityColumn.php index ea32440f..395e3260 100644 --- a/src/DataTables/Column/EntityColumn.php +++ b/src/DataTables/Column/EntityColumn.php @@ -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) { diff --git a/src/DataTables/Column/LogEntryExtraColumn.php b/src/DataTables/Column/LogEntryExtraColumn.php index 6e215479..a7c09b42 100644 --- a/src/DataTables/Column/LogEntryExtraColumn.php +++ b/src/DataTables/Column/LogEntryExtraColumn.php @@ -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) { diff --git a/src/DataTables/Column/LogEntryTargetColumn.php b/src/DataTables/Column/LogEntryTargetColumn.php index b4d4a849..8bdcdce7 100644 --- a/src/DataTables/Column/LogEntryTargetColumn.php +++ b/src/DataTables/Column/LogEntryTargetColumn.php @@ -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) diff --git a/src/DataTables/Column/MarkdownColumn.php b/src/DataTables/Column/MarkdownColumn.php index e20e22c2..1abe5c2f 100644 --- a/src/DataTables/Column/MarkdownColumn.php +++ b/src/DataTables/Column/MarkdownColumn.php @@ -47,7 +47,7 @@ use Omines\DataTablesBundle\Column\AbstractColumn; class MarkdownColumn extends AbstractColumn { - protected $markdown; + protected MarkdownParser $markdown; public function __construct(MarkdownParser $markdown) { diff --git a/src/DataTables/Column/PartAttachmentsColumn.php b/src/DataTables/Column/PartAttachmentsColumn.php index 4692c74b..f59ad5a6 100644 --- a/src/DataTables/Column/PartAttachmentsColumn.php +++ b/src/DataTables/Column/PartAttachmentsColumn.php @@ -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) { diff --git a/src/DataTables/Column/PrettyBoolColumn.php b/src/DataTables/Column/PrettyBoolColumn.php index da6af1c4..7441cb1a 100644 --- a/src/DataTables/Column/PrettyBoolColumn.php +++ b/src/DataTables/Column/PrettyBoolColumn.php @@ -7,8 +7,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class PrettyBoolColumn extends AbstractColumn { - - protected $translator; + protected TranslatorInterface $translator; public function __construct(TranslatorInterface $translator) { diff --git a/src/DataTables/Column/RevertLogColumn.php b/src/DataTables/Column/RevertLogColumn.php index 09db18fb..9284a755 100644 --- a/src/DataTables/Column/RevertLogColumn.php +++ b/src/DataTables/Column/RevertLogColumn.php @@ -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) { diff --git a/src/DataTables/Column/SIUnitNumberColumn.php b/src/DataTables/Column/SIUnitNumberColumn.php index 77d2a197..d3f739dc 100644 --- a/src/DataTables/Column/SIUnitNumberColumn.php +++ b/src/DataTables/Column/SIUnitNumberColumn.php @@ -8,7 +8,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class SIUnitNumberColumn extends AbstractColumn { - protected $formatter; + protected SIFormatter $formatter; public function __construct(SIFormatter $formatter) { diff --git a/src/DataTables/Column/TagsColumn.php b/src/DataTables/Column/TagsColumn.php index d02dc1f9..745df916 100644 --- a/src/DataTables/Column/TagsColumn.php +++ b/src/DataTables/Column/TagsColumn.php @@ -47,7 +47,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class TagsColumn extends AbstractColumn { - protected $urlGenerator; + protected UrlGeneratorInterface $urlGenerator; public function __construct(UrlGeneratorInterface $urlGenerator) { diff --git a/src/DataTables/Filters/AttachmentFilter.php b/src/DataTables/Filters/AttachmentFilter.php index bbdadca2..bd335751 100644 --- a/src/DataTables/Filters/AttachmentFilter.php +++ b/src/DataTables/Filters/AttachmentFilter.php @@ -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) diff --git a/src/DataTables/Filters/Constraints/AbstractConstraint.php b/src/DataTables/Filters/Constraints/AbstractConstraint.php index 0af33ce5..4e6274f8 100644 --- a/src/DataTables/Filters/Constraints/AbstractConstraint.php +++ b/src/DataTables/Filters/Constraints/AbstractConstraint.php @@ -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; /** diff --git a/src/DataTables/Filters/Constraints/BooleanConstraint.php b/src/DataTables/Filters/Constraints/BooleanConstraint.php index c72c7c6e..3db87586 100644 --- a/src/DataTables/Filters/Constraints/BooleanConstraint.php +++ b/src/DataTables/Filters/Constraints/BooleanConstraint.php @@ -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) diff --git a/src/DataTables/Filters/Constraints/ChoiceConstraint.php b/src/DataTables/Filters/Constraints/ChoiceConstraint.php index 63737cc0..14e3b3d0 100644 --- a/src/DataTables/Filters/Constraints/ChoiceConstraint.php +++ b/src/DataTables/Filters/Constraints/ChoiceConstraint.php @@ -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[] diff --git a/src/DataTables/Filters/Constraints/EntityConstraint.php b/src/DataTables/Filters/Constraints/EntityConstraint.php index 52a1c642..abd5344f 100644 --- a/src/DataTables/Filters/Constraints/EntityConstraint.php +++ b/src/DataTables/Filters/Constraints/EntityConstraint.php @@ -18,17 +18,17 @@ class EntityConstraint extends AbstractConstraint /** * @var NodesListBuilder */ - protected $nodesListBuilder; + protected ?NodesListBuilder $nodesListBuilder; /** * @var class-string 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 diff --git a/src/DataTables/Filters/Constraints/FilterTrait.php b/src/DataTables/Filters/Constraints/FilterTrait.php index 5371a48d..4ce7d4c6 100644 --- a/src/DataTables/Filters/Constraints/FilterTrait.php +++ b/src/DataTables/Filters/Constraints/FilterTrait.php @@ -8,7 +8,7 @@ use Doctrine\ORM\QueryBuilder; trait FilterTrait { - protected $useHaving = false; + protected bool $useHaving = false; public function useHaving($value = true): self { diff --git a/src/DataTables/Filters/Constraints/InstanceOfConstraint.php b/src/DataTables/Filters/Constraints/InstanceOfConstraint.php index c3f11e4a..120566d6 100644 --- a/src/DataTables/Filters/Constraints/InstanceOfConstraint.php +++ b/src/DataTables/Filters/Constraints/InstanceOfConstraint.php @@ -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[] diff --git a/src/DataTables/Filters/Constraints/NumberConstraint.php b/src/DataTables/Filters/Constraints/NumberConstraint.php index bacd289a..67e3d028 100644 --- a/src/DataTables/Filters/Constraints/NumberConstraint.php +++ b/src/DataTables/Filters/Constraints/NumberConstraint.php @@ -26,7 +26,7 @@ class NumberConstraint extends AbstractConstraint /** * @var string The operator to use */ - protected $operator; + protected ?string $operator; /** * @return float|int|null|\DateTimeInterface diff --git a/src/DataTables/Filters/Constraints/Part/ParameterConstraint.php b/src/DataTables/Filters/Constraints/Part/ParameterConstraint.php index 58509546..6c5825f0 100644 --- a/src/DataTables/Filters/Constraints/Part/ParameterConstraint.php +++ b/src/DataTables/Filters/Constraints/Part/ParameterConstraint.php @@ -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() { diff --git a/src/DataTables/Filters/Constraints/Part/ParameterValueConstraint.php b/src/DataTables/Filters/Constraints/Part/ParameterValueConstraint.php index 27b91965..e4a80539 100644 --- a/src/DataTables/Filters/Constraints/Part/ParameterValueConstraint.php +++ b/src/DataTables/Filters/Constraints/Part/ParameterValueConstraint.php @@ -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 diff --git a/src/DataTables/Filters/Constraints/Part/TagsConstraint.php b/src/DataTables/Filters/Constraints/Part/TagsConstraint.php index ecfb6274..47425382 100644 --- a/src/DataTables/Filters/Constraints/Part/TagsConstraint.php +++ b/src/DataTables/Filters/Constraints/Part/TagsConstraint.php @@ -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 diff --git a/src/DataTables/Filters/Constraints/TextConstraint.php b/src/DataTables/Filters/Constraints/TextConstraint.php index 3ce5c7eb..f4c77660 100644 --- a/src/DataTables/Filters/Constraints/TextConstraint.php +++ b/src/DataTables/Filters/Constraints/TextConstraint.php @@ -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 diff --git a/src/DataTables/Filters/LogFilter.php b/src/DataTables/Filters/LogFilter.php index ad24b29e..90356f30 100644 --- a/src/DataTables/Filters/LogFilter.php +++ b/src/DataTables/Filters/LogFilter.php @@ -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() { diff --git a/src/DataTables/Filters/PartFilter.php b/src/DataTables/Filters/PartFilter.php index 2d3e6087..bb5d0a0c 100644 --- a/src/DataTables/Filters/PartFilter.php +++ b/src/DataTables/Filters/PartFilter.php @@ -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 */ - protected $parameters; - - /** @var IntConstraint */ - protected $parametersCount; + protected ArrayCollection $parameters; + protected IntConstraint $parametersCount; public function __construct(NodesListBuilder $nodesListBuilder) { diff --git a/src/DataTables/Filters/PartSearchFilter.php b/src/DataTables/Filters/PartSearchFilter.php index 01538a16..eb8960ed 100644 --- a/src/DataTables/Filters/PartSearchFilter.php +++ b/src/DataTables/Filters/PartSearchFilter.php @@ -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) { diff --git a/src/DataTables/LogDataTable.php b/src/DataTables/LogDataTable.php index e675d681..37c0ba13 100644 --- a/src/DataTables/LogDataTable.php +++ b/src/DataTables/LogDataTable.php @@ -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) diff --git a/src/DataTables/PartsDataTable.php b/src/DataTables/PartsDataTable.php index e9be7f6a..eae7cb6b 100644 --- a/src/DataTables/PartsDataTable.php +++ b/src/DataTables/PartsDataTable.php @@ -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 diff --git a/src/Entity/Attachments/Attachment.php b/src/Entity/Attachments/Attachment.php index 21370064..d0dbc568 100644 --- a/src/Entity/Attachments/Attachment.php +++ b/src/Entity/Attachments/Attachment.php @@ -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() { diff --git a/src/Entity/Attachments/AttachmentType.php b/src/Entity/Attachments/AttachmentType.php index ae102bd1..3cb0e273 100644 --- a/src/Entity/Attachments/AttachmentType.php +++ b/src/Entity/Attachments/AttachmentType.php @@ -55,7 +55,7 @@ class AttachmentType extends AbstractStructuralDBElement * @ORM\Column(type="text") * @ValidFileFilter */ - protected $filetype_filter = ''; + protected string $filetype_filter = ''; /** * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) diff --git a/src/Entity/Attachments/AttachmentTypeAttachment.php b/src/Entity/Attachments/AttachmentTypeAttachment.php index f95c91c6..7aeb79e5 100644 --- a/src/Entity/Attachments/AttachmentTypeAttachment.php +++ b/src/Entity/Attachments/AttachmentTypeAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/CategoryAttachment.php b/src/Entity/Attachments/CategoryAttachment.php index bf25fd53..75300ca3 100644 --- a/src/Entity/Attachments/CategoryAttachment.php +++ b/src/Entity/Attachments/CategoryAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/CurrencyAttachment.php b/src/Entity/Attachments/CurrencyAttachment.php index 1e49b9a2..13afc2ae 100644 --- a/src/Entity/Attachments/CurrencyAttachment.php +++ b/src/Entity/Attachments/CurrencyAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/DeviceAttachment.php b/src/Entity/Attachments/DeviceAttachment.php index 93f2235b..c953a9c3 100644 --- a/src/Entity/Attachments/DeviceAttachment.php +++ b/src/Entity/Attachments/DeviceAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/FootprintAttachment.php b/src/Entity/Attachments/FootprintAttachment.php index 5335c0d0..73e3e263 100644 --- a/src/Entity/Attachments/FootprintAttachment.php +++ b/src/Entity/Attachments/FootprintAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/GroupAttachment.php b/src/Entity/Attachments/GroupAttachment.php index dfc592af..a882bba9 100644 --- a/src/Entity/Attachments/GroupAttachment.php +++ b/src/Entity/Attachments/GroupAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/LabelAttachment.php b/src/Entity/Attachments/LabelAttachment.php index 53927edf..fea47803 100644 --- a/src/Entity/Attachments/LabelAttachment.php +++ b/src/Entity/Attachments/LabelAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/ManufacturerAttachment.php b/src/Entity/Attachments/ManufacturerAttachment.php index 73c499a1..e5d81e16 100644 --- a/src/Entity/Attachments/ManufacturerAttachment.php +++ b/src/Entity/Attachments/ManufacturerAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/MeasurementUnitAttachment.php b/src/Entity/Attachments/MeasurementUnitAttachment.php index 6ba813fc..853f5421 100644 --- a/src/Entity/Attachments/MeasurementUnitAttachment.php +++ b/src/Entity/Attachments/MeasurementUnitAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/PartAttachment.php b/src/Entity/Attachments/PartAttachment.php index 20974127..416595fe 100644 --- a/src/Entity/Attachments/PartAttachment.php +++ b/src/Entity/Attachments/PartAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/StorelocationAttachment.php b/src/Entity/Attachments/StorelocationAttachment.php index a8a42e6e..fedb3adf 100644 --- a/src/Entity/Attachments/StorelocationAttachment.php +++ b/src/Entity/Attachments/StorelocationAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/SupplierAttachment.php b/src/Entity/Attachments/SupplierAttachment.php index a4904211..15fa7aa7 100644 --- a/src/Entity/Attachments/SupplierAttachment.php +++ b/src/Entity/Attachments/SupplierAttachment.php @@ -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; } diff --git a/src/Entity/Attachments/UserAttachment.php b/src/Entity/Attachments/UserAttachment.php index 6aeaa638..8823238f 100644 --- a/src/Entity/Attachments/UserAttachment.php +++ b/src/Entity/Attachments/UserAttachment.php @@ -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; } diff --git a/src/Entity/Base/AbstractCompany.php b/src/Entity/Base/AbstractCompany.php index 3ff32987..42470bc2 100644 --- a/src/Entity/Base/AbstractCompany.php +++ b/src/Entity/Base/AbstractCompany.php @@ -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 = ''; /******************************************************************************** * diff --git a/src/Entity/Base/AbstractDBElement.php b/src/Entity/Base/AbstractDBElement.php index a526e8ce..b3cadb25 100644 --- a/src/Entity/Base/AbstractDBElement.php +++ b/src/Entity/Base/AbstractDBElement.php @@ -65,7 +65,7 @@ abstract class AbstractDBElement implements JsonSerializable * @ORM\GeneratedValue() * @Groups({"full"}) */ - protected $id; + protected ?int $id = null; public function __clone() { diff --git a/src/Entity/Base/AbstractNamedDBElement.php b/src/Entity/Base/AbstractNamedDBElement.php index 1cb5ac85..f10f2773 100644 --- a/src/Entity/Base/AbstractNamedDBElement.php +++ b/src/Entity/Base/AbstractNamedDBElement.php @@ -44,7 +44,7 @@ abstract class AbstractNamedDBElement extends AbstractDBElement implements Named * @Assert\NotBlank() * @Groups({"simple", "extended", "full"}) */ - protected $name = ''; + protected string $name = ''; /****************************************************************************** * diff --git a/src/Entity/Base/AbstractStructuralDBElement.php b/src/Entity/Base/AbstractStructuralDBElement.php index efc9c34c..504d730c 100644 --- a/src/Entity/Base/AbstractStructuralDBElement.php +++ b/src/Entity/Base/AbstractStructuralDBElement.php @@ -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() { diff --git a/src/Entity/Base/MasterAttachmentTrait.php b/src/Entity/Base/MasterAttachmentTrait.php index ce315fa8..383a6151 100644 --- a/src/Entity/Base/MasterAttachmentTrait.php +++ b/src/Entity/Base/MasterAttachmentTrait.php @@ -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). diff --git a/src/Entity/Base/TimestampTrait.php b/src/Entity/Base/TimestampTrait.php index 004b301c..e133e02e 100644 --- a/src/Entity/Base/TimestampTrait.php +++ b/src/Entity/Base/TimestampTrait.php @@ -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. diff --git a/src/Entity/Devices/Device.php b/src/Entity/Devices/Device.php index a6bf20ec..e928cbda 100644 --- a/src/Entity/Devices/Device.php +++ b/src/Entity/Devices/Device.php @@ -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 * @ORM\OneToMany(targetEntity="App\Entity\Attachments\DeviceAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) diff --git a/src/Entity/Devices/DevicePart.php b/src/Entity/Devices/DevicePart.php index 8af264d4..8e1157f2 100644 --- a/src/Entity/Devices/DevicePart.php +++ b/src/Entity/Devices/DevicePart.php @@ -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; } diff --git a/src/Entity/LabelSystem/LabelOptions.php b/src/Entity/LabelSystem/LabelOptions.php index 417df882..5c8ddabc 100644 --- a/src/Entity/LabelSystem/LabelOptions.php +++ b/src/Entity/LabelSystem/LabelOptions.php @@ -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 { diff --git a/src/Entity/LabelSystem/LabelProfile.php b/src/Entity/LabelSystem/LabelProfile.php index e1a5f8ee..75f4a1a6 100644 --- a/src/Entity/LabelSystem/LabelProfile.php +++ b/src/Entity/LabelSystem/LabelProfile.php @@ -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() { diff --git a/src/Entity/LogSystem/AbstractLogEntry.php b/src/Entity/LogSystem/AbstractLogEntry.php index 83440719..54c5dcc5 100644 --- a/src/Entity/LogSystem/AbstractLogEntry.php +++ b/src/Entity/LogSystem/AbstractLogEntry.php @@ -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") diff --git a/src/Entity/LogSystem/CollectionElementDeleted.php b/src/Entity/LogSystem/CollectionElementDeleted.php index 20530b58..f838ca14 100644 --- a/src/Entity/LogSystem/CollectionElementDeleted.php +++ b/src/Entity/LogSystem/CollectionElementDeleted.php @@ -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) { diff --git a/src/Entity/LogSystem/ConfigChangedLogEntry.php b/src/Entity/LogSystem/ConfigChangedLogEntry.php index 19367439..56c01993 100644 --- a/src/Entity/LogSystem/ConfigChangedLogEntry.php +++ b/src/Entity/LogSystem/ConfigChangedLogEntry.php @@ -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() { diff --git a/src/Entity/LogSystem/DatabaseUpdatedLogEntry.php b/src/Entity/LogSystem/DatabaseUpdatedLogEntry.php index 5ee0fe04..e850620c 100644 --- a/src/Entity/LogSystem/DatabaseUpdatedLogEntry.php +++ b/src/Entity/LogSystem/DatabaseUpdatedLogEntry.php @@ -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) { diff --git a/src/Entity/LogSystem/ElementCreatedLogEntry.php b/src/Entity/LogSystem/ElementCreatedLogEntry.php index e36b888c..040fe1a6 100644 --- a/src/Entity/LogSystem/ElementCreatedLogEntry.php +++ b/src/Entity/LogSystem/ElementCreatedLogEntry.php @@ -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) { diff --git a/src/Entity/LogSystem/ElementDeletedLogEntry.php b/src/Entity/LogSystem/ElementDeletedLogEntry.php index da480f9b..1c52b5de 100644 --- a/src/Entity/LogSystem/ElementDeletedLogEntry.php +++ b/src/Entity/LogSystem/ElementDeletedLogEntry.php @@ -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) { diff --git a/src/Entity/LogSystem/ElementEditedLogEntry.php b/src/Entity/LogSystem/ElementEditedLogEntry.php index 9696d4ad..8c70ce72 100644 --- a/src/Entity/LogSystem/ElementEditedLogEntry.php +++ b/src/Entity/LogSystem/ElementEditedLogEntry.php @@ -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) { diff --git a/src/Entity/LogSystem/ExceptionLogEntry.php b/src/Entity/LogSystem/ExceptionLogEntry.php index 07bcccd5..1ab4766a 100644 --- a/src/Entity/LogSystem/ExceptionLogEntry.php +++ b/src/Entity/LogSystem/ExceptionLogEntry.php @@ -50,7 +50,7 @@ use Doctrine\ORM\Mapping as ORM; */ class ExceptionLogEntry extends AbstractLogEntry { - protected $typeString = 'exception'; + protected string $typeString = 'exception'; public function __construct() { diff --git a/src/Entity/LogSystem/InstockChangedLogEntry.php b/src/Entity/LogSystem/InstockChangedLogEntry.php index cd51dfcf..550df30a 100644 --- a/src/Entity/LogSystem/InstockChangedLogEntry.php +++ b/src/Entity/LogSystem/InstockChangedLogEntry.php @@ -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. diff --git a/src/Entity/LogSystem/UserLoginLogEntry.php b/src/Entity/LogSystem/UserLoginLogEntry.php index 76ebfa44..9df2400a 100644 --- a/src/Entity/LogSystem/UserLoginLogEntry.php +++ b/src/Entity/LogSystem/UserLoginLogEntry.php @@ -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) { diff --git a/src/Entity/LogSystem/UserLogoutLogEntry.php b/src/Entity/LogSystem/UserLogoutLogEntry.php index 9cb93bb4..ec4df8b4 100644 --- a/src/Entity/LogSystem/UserLogoutLogEntry.php +++ b/src/Entity/LogSystem/UserLogoutLogEntry.php @@ -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) { diff --git a/src/Entity/LogSystem/UserNotAllowedLogEntry.php b/src/Entity/LogSystem/UserNotAllowedLogEntry.php index 1967d62e..3fe549ab 100644 --- a/src/Entity/LogSystem/UserNotAllowedLogEntry.php +++ b/src/Entity/LogSystem/UserNotAllowedLogEntry.php @@ -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) { diff --git a/src/Entity/Parameters/AbstractParameter.php b/src/Entity/Parameters/AbstractParameter.php index b7427985..2a1dc45c 100644 --- a/src/Entity/Parameters/AbstractParameter.php +++ b/src/Entity/Parameters/AbstractParameter.php @@ -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. diff --git a/src/Entity/Parts/Category.php b/src/Entity/Parts/Category.php index 4be541bb..5401b7c4 100644 --- a/src/Entity/Parts/Category.php +++ b/src/Entity/Parts/Category.php @@ -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 * @ORM\OneToMany(targetEntity="App\Entity\Attachments\CategoryAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) diff --git a/src/Entity/Parts/Footprint.php b/src/Entity/Parts/Footprint.php index 0e4b477a..7d2bb09d 100644 --- a/src/Entity/Parts/Footprint.php +++ b/src/Entity/Parts/Footprint.php @@ -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 * @ORM\OneToMany(targetEntity="App\Entity\Parameters\FootprintParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) diff --git a/src/Entity/Parts/MeasurementUnit.php b/src/Entity/Parts/MeasurementUnit.php index bd0f1648..74fb61bc 100644 --- a/src/Entity/Parts/MeasurementUnit.php +++ b/src/Entity/Parts/MeasurementUnit.php @@ -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"}) diff --git a/src/Entity/Parts/Part.php b/src/Entity/Parts/Part.php index 7743ac3f..bfd30ee7 100644 --- a/src/Entity/Parts/Part.php +++ b/src/Entity/Parts/Part.php @@ -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 @@ -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() { diff --git a/src/Entity/Parts/PartLot.php b/src/Entity/Parts/PartLot.php index 1bbfbe87..498f8e63 100644 --- a/src/Entity/Parts/PartLot.php +++ b/src/Entity/Parts/PartLot.php @@ -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() { diff --git a/src/Entity/Parts/PartTraits/AdvancedPropertyTrait.php b/src/Entity/Parts/PartTraits/AdvancedPropertyTrait.php index 3e405bd7..2413490c 100644 --- a/src/Entity/Parts/PartTraits/AdvancedPropertyTrait.php +++ b/src/Entity/Parts/PartTraits/AdvancedPropertyTrait.php @@ -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. diff --git a/src/Entity/Parts/PartTraits/BasicPropertyTrait.php b/src/Entity/Parts/PartTraits/BasicPropertyTrait.php index f30a1abb..f43b6f7a 100644 --- a/src/Entity/Parts/PartTraits/BasicPropertyTrait.php +++ b/src/Entity/Parts/PartTraits/BasicPropertyTrait.php @@ -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. diff --git a/src/Entity/Parts/PartTraits/InstockTrait.php b/src/Entity/Parts/PartTraits/InstockTrait.php index 4f910e38..deca8424 100644 --- a/src/Entity/Parts/PartTraits/InstockTrait.php +++ b/src/Entity/Parts/PartTraits/InstockTrait.php @@ -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. diff --git a/src/Entity/Parts/PartTraits/ManufacturerTrait.php b/src/Entity/Parts/PartTraits/ManufacturerTrait.php index 876381c1..669867a3 100644 --- a/src/Entity/Parts/PartTraits/ManufacturerTrait.php +++ b/src/Entity/Parts/PartTraits/ManufacturerTrait.php @@ -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 diff --git a/src/Entity/Parts/PartTraits/OrderTrait.php b/src/Entity/Parts/PartTraits/OrderTrait.php index a46b1f1e..e0ee8744 100644 --- a/src/Entity/Parts/PartTraits/OrderTrait.php +++ b/src/Entity/Parts/PartTraits/OrderTrait.php @@ -69,14 +69,14 @@ trait OrderTrait * @ORM\Column(type="integer") * @ColumnSecurity(prefix="order", type="integer") */ - protected $order_quantity = 0; + protected int $order_quantity = 0; /** * @var bool * @ORM\Column(type="boolean") * @ColumnSecurity(prefix="order", type="boolean") */ - protected $manual_order = false; + protected bool $manual_order = false; /** * @var Orderdetail @@ -85,7 +85,7 @@ trait OrderTrait * * @ColumnSecurity(prefix="order", type="object") */ - protected $order_orderdetail; + protected Orderdetail $order_orderdetail; /** * Get the selected order orderdetails of this part. diff --git a/src/Entity/Parts/Storelocation.php b/src/Entity/Parts/Storelocation.php index 2440b03d..a2a34681 100644 --- a/src/Entity/Parts/Storelocation.php +++ b/src/Entity/Parts/Storelocation.php @@ -83,7 +83,7 @@ class Storelocation extends AbstractPartsContainingDBElement * @ORM\ManyToOne(targetEntity="MeasurementUnit") * @ORM\JoinColumn(name="storage_type_id", referencedColumnName="id") */ - protected $storage_type; + protected ?MeasurementUnit $storage_type = null; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\StorelocationParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) @@ -96,19 +96,19 @@ class Storelocation extends AbstractPartsContainingDBElement * @var bool * @ORM\Column(type="boolean") */ - protected $is_full = false; + protected bool $is_full = false; /** * @var bool * @ORM\Column(type="boolean") */ - protected $only_single_part = false; + protected bool $only_single_part = false; /** * @var bool * @ORM\Column(type="boolean") */ - protected $limit_to_existing_parts = false; + protected bool $limit_to_existing_parts = false; /** * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\StorelocationAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) diff --git a/src/Entity/Parts/Supplier.php b/src/Entity/Parts/Supplier.php index dc3ce664..45d7ae69 100644 --- a/src/Entity/Parts/Supplier.php +++ b/src/Entity/Parts/Supplier.php @@ -94,14 +94,14 @@ class Supplier extends AbstractCompany * @ORM\JoinColumn(name="default_currency_id", referencedColumnName="id", nullable=true) * @Selectable() */ - protected $default_currency; + protected ?Currency $default_currency = null; /** * @var BigDecimal|null the shipping costs that have to be paid, when ordering via this supplier * @ORM\Column(name="shipping_costs", nullable=true, type="big_decimal", precision=11, scale=5) * @BigDecimalPositiveOrZero() */ - protected $shipping_costs; + protected ?BigDecimal $shipping_costs = null; /** * @var Collection diff --git a/src/Entity/PriceInformations/Currency.php b/src/Entity/PriceInformations/Currency.php index f6dd87de..53bedf03 100644 --- a/src/Entity/PriceInformations/Currency.php +++ b/src/Entity/PriceInformations/Currency.php @@ -71,14 +71,14 @@ class Currency extends AbstractStructuralDBElement * @ORM\Column(type="big_decimal", precision=11, scale=5, nullable=true) * @BigDecimalPositive() */ - protected $exchange_rate; + protected ?BigDecimal $exchange_rate = null; /** * @var string the 3 letter ISO code of the currency * @ORM\Column(type="string") * @Assert\Currency() */ - protected $iso_code; + protected string $iso_code; /** * @ORM\OneToMany(targetEntity="Currency", mappedBy="parent", cascade={"persist"}) diff --git a/src/Entity/PriceInformations/Orderdetail.php b/src/Entity/PriceInformations/Orderdetail.php index 150c9dd1..8cf69c53 100644 --- a/src/Entity/PriceInformations/Orderdetail.php +++ b/src/Entity/PriceInformations/Orderdetail.php @@ -86,20 +86,20 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N * @var string * @ORM\Column(type="string") */ - protected $supplierpartnr = ''; + protected string $supplierpartnr = ''; /** * @var bool * @ORM\Column(type="boolean") */ - protected $obsolete = false; + protected bool $obsolete = false; /** * @var string * @ORM\Column(type="string") * @Assert\Url() */ - protected $supplier_product_url = ''; + protected string $supplier_product_url = ''; /** * @var Part @@ -107,7 +107,7 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N * @ORM\JoinColumn(name="part_id", referencedColumnName="id", nullable=false, onDelete="CASCADE") * @Assert\NotNull() */ - protected $part; + protected ?Part $part = null; /** * @var Supplier @@ -115,7 +115,7 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N * @ORM\JoinColumn(name="id_supplier", referencedColumnName="id") * @Assert\NotNull(message="validator.orderdetail.supplier_must_not_be_null") */ - protected $supplier; + protected ?Supplier $supplier = null; public function __construct() { diff --git a/src/Entity/PriceInformations/Pricedetail.php b/src/Entity/PriceInformations/Pricedetail.php index 494e5de6..891f5add 100644 --- a/src/Entity/PriceInformations/Pricedetail.php +++ b/src/Entity/PriceInformations/Pricedetail.php @@ -81,7 +81,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface * @ORM\Column(type="big_decimal", precision=11, scale=5) * @BigDecimalPositive() */ - protected $price; + protected BigDecimal $price; /** * @var ?Currency The currency used for the current price information. @@ -90,27 +90,27 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface * @ORM\JoinColumn(name="id_currency", referencedColumnName="id", nullable=true) * @Selectable() */ - protected $currency; + protected ?Currency $currency = null; /** * @var float * @ORM\Column(type="float") * @Assert\Positive() */ - protected $price_related_quantity = 1.0; + protected float $price_related_quantity = 1.0; /** * @var float * @ORM\Column(type="float") * @Assert\Positive() */ - protected $min_discount_quantity = 1.0; + protected float $min_discount_quantity = 1.0; /** * @var bool * @ORM\Column(type="boolean") */ - protected $manual_input = true; + protected bool $manual_input = true; /** * @var Orderdetail|null @@ -118,7 +118,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface * @ORM\JoinColumn(name="orderdetails_id", referencedColumnName="id", nullable=false, onDelete="CASCADE") * @Assert\NotNull() */ - protected $orderdetail; + protected ?Orderdetail $orderdetail = null; public function __construct() { diff --git a/src/Entity/UserSystem/Group.php b/src/Entity/UserSystem/Group.php index c039c6c8..e9cab853 100644 --- a/src/Entity/UserSystem/Group.php +++ b/src/Entity/UserSystem/Group.php @@ -76,7 +76,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa /** * @ORM\OneToMany(targetEntity="User", mappedBy="group") */ - protected $users; + protected Collection $users; /** * @var bool If true all users associated with this group must have enabled some kind of 2 factor authentication diff --git a/src/Entity/UserSystem/U2FKey.php b/src/Entity/UserSystem/U2FKey.php index b7f8f6da..d4e6aa05 100644 --- a/src/Entity/UserSystem/U2FKey.php +++ b/src/Entity/UserSystem/U2FKey.php @@ -68,49 +68,47 @@ class U2FKey implements TwoFactorKeyInterface * * @var string **/ - public $keyHandle; + public string $keyHandle; /** * @ORM\Column(type="string") * * @var string **/ - public $publicKey; + public string $publicKey; /** * @ORM\Column(type="text") * * @var string **/ - public $certificate; + public string $certificate; /** * @ORM\Column(type="string") * * @var int **/ - public $counter; + public int $counter; /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - protected $id; + protected int $id; /** * @ORM\Column(type="string") * * @var string **/ - protected $name; + protected string $name; /** * @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", inversedBy="u2fKeys") - * - * @var User **/ - protected $user; + protected ?User $user = null; public function fromRegistrationData(Registration $data): void { diff --git a/src/Entity/UserSystem/User.php b/src/Entity/UserSystem/User.php index 86d7866f..7f93091f 100644 --- a/src/Entity/UserSystem/User.php +++ b/src/Entity/UserSystem/User.php @@ -101,48 +101,48 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe * @var bool Determines if the user is disabled (user can not log in) * @ORM\Column(type="boolean") */ - protected $disabled = false; + protected bool $disabled = false; /** * @var string|null The theme * @ORM\Column(type="string", name="config_theme", nullable=true) * @Assert\Choice(choices=User::AVAILABLE_THEMES) */ - protected $theme = ''; + protected ?string $theme = ''; /** * @var string|null the hash of a token the user must provide when he wants to reset his password * @ORM\Column(type="string", nullable=true) */ - protected $pw_reset_token; + protected ?string $pw_reset_token = null; /** * @ORM\Column(type="text", name="config_instock_comment_a") */ - protected $instock_comment_a = ''; + protected string $instock_comment_a = ''; /** * @ORM\Column(type="text", name="config_instock_comment_w") */ - protected $instock_comment_w = ''; + protected string $instock_comment_w = ''; /** @var int The version of the trusted device cookie. Used to invalidate all trusted device cookies at once. * @ORM\Column(type="integer") */ - protected $trustedDeviceCookieVersion = 0; + protected int $trustedDeviceCookieVersion = 0; /** * @var string[]|null A list of backup codes that can be used, if the user has no access to its Google Authenticator device * @ORM\Column(type="json") */ - protected $backupCodes = []; + protected ?array $backupCodes = []; /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ - protected $id; + protected ?int $id = null; /** * @var Group|null the group this user belongs to @@ -150,58 +150,58 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe * @ORM\JoinColumn(name="group_id", referencedColumnName="id") * @Selectable() */ - protected $group; + protected ?Group $group = null; /** * @var string|null The secret used for google authenticator * @ORM\Column(name="google_authenticator_secret", type="string", nullable=true) */ - protected $googleAuthenticatorSecret; + protected ?string $googleAuthenticatorSecret = null; /** * @var string|null The timezone the user prefers * @ORM\Column(type="string", name="config_timezone", nullable=true) * @Assert\Timezone() */ - protected $timezone = ''; + protected ?string $timezone = ''; /** * @var string|null The language/locale the user prefers * @ORM\Column(type="string", name="config_language", nullable=true) * @Assert\Language() */ - protected $language = ''; + protected ?string $language = ''; /** * @var string|null The email address of the user * @ORM\Column(type="string", length=255, nullable=true) * @Assert\Email() */ - protected $email = ''; + protected ?string $email = ''; /** * @var string|null The department the user is working * @ORM\Column(type="string", length=255, nullable=true) */ - protected $department = ''; + protected ?string $department = ''; /** * @var string|null The last name of the User * @ORM\Column(type="string", length=255, nullable=true) */ - protected $last_name = ''; + protected ?string $last_name = ''; /** * @var string|null The first name of the User * @ORM\Column(type="string", length=255, nullable=true) */ - protected $first_name = ''; + protected ?string $first_name = ''; /** * @var bool True if the user needs to change password after log in * @ORM\Column(type="boolean") */ - protected $need_pw_change = true; + protected bool $need_pw_change = true; /** * //@ORM\Column(type="json"). @@ -212,20 +212,20 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe * @var string|null The hashed password * @ORM\Column(type="string", nullable=true) */ - protected $password; + protected ?string $password = null; /** * @ORM\Column(type="string", length=180, unique=true) * @Assert\NotBlank * @Assert\Regex("/^[\w\.\+\-\$]+$/", message="user.invalid_username") */ - protected $name = ''; + protected string $name = ''; /** * @var array * @ORM\Column(type="json") */ - protected $settings = []; + protected ?array $settings = []; /** * @var Collection @@ -237,7 +237,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe /** @var DateTime|null The time when the backup codes were generated * @ORM\Column(type="datetime", nullable=true) */ - protected $backupCodesGenerationDate; + protected ?DateTime $backupCodesGenerationDate = null; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\UserSystem\U2FKey", mappedBy="user", cascade={"REMOVE"}, orphanRemoval=true) diff --git a/src/EntityListeners/AttachmentDeleteListener.php b/src/EntityListeners/AttachmentDeleteListener.php index 17bc0088..625d8994 100644 --- a/src/EntityListeners/AttachmentDeleteListener.php +++ b/src/EntityListeners/AttachmentDeleteListener.php @@ -59,9 +59,9 @@ use SplFileInfo; */ class AttachmentDeleteListener { - protected $attachmentReverseSearch; - protected $attachmentHelper; - protected $pathResolver; + protected AttachmentReverseSearch $attachmentReverseSearch; + protected AttachmentManager $attachmentHelper; + protected AttachmentPathResolver $pathResolver; public function __construct(AttachmentReverseSearch $attachmentReverseSearch, AttachmentManager $attachmentHelper, AttachmentPathResolver $pathResolver) { diff --git a/src/EntityListeners/TreeCacheInvalidationListener.php b/src/EntityListeners/TreeCacheInvalidationListener.php index 22877421..cb49c09f 100644 --- a/src/EntityListeners/TreeCacheInvalidationListener.php +++ b/src/EntityListeners/TreeCacheInvalidationListener.php @@ -55,8 +55,8 @@ use Symfony\Contracts\Cache\TagAwareCacheInterface; class TreeCacheInvalidationListener { - protected $cache; - protected $keyGenerator; + protected TagAwareCacheInterface $cache; + protected UserCacheKeyGenerator $keyGenerator; public function __construct(TagAwareCacheInterface $treeCache, UserCacheKeyGenerator $keyGenerator) { diff --git a/src/EventSubscriber/LogSystem/EventLoggerSubscriber.php b/src/EventSubscriber/LogSystem/EventLoggerSubscriber.php index e12ba158..4fe79ece 100644 --- a/src/EventSubscriber/LogSystem/EventLoggerSubscriber.php +++ b/src/EventSubscriber/LogSystem/EventLoggerSubscriber.php @@ -90,14 +90,14 @@ class EventLoggerSubscriber implements EventSubscriber protected const MAX_STRING_LENGTH = 2000; - protected $logger; - protected $serializer; - protected $eventCommentHelper; - protected $eventUndoHelper; - protected $save_changed_fields; - protected $save_changed_data; - protected $save_removed_data; - protected $propertyAccessor; + protected EventLogger $logger; + protected SerializerInterface $serializer; + protected EventCommentHelper $eventCommentHelper; + protected EventUndoHelper $eventUndoHelper; + protected bool $save_changed_fields; + protected bool $save_changed_data; + protected bool $save_removed_data; + protected PropertyAccessorInterface $propertyAccessor; public function __construct(EventLogger $logger, SerializerInterface $serializer, EventCommentHelper $commentHelper, bool $save_changed_fields, bool $save_changed_data, bool $save_removed_data, PropertyAccessorInterface $propertyAccessor, diff --git a/src/EventSubscriber/LogSystem/LogAccessDeniedSubscriber.php b/src/EventSubscriber/LogSystem/LogAccessDeniedSubscriber.php index ae3e5e0f..d6c8a739 100644 --- a/src/EventSubscriber/LogSystem/LogAccessDeniedSubscriber.php +++ b/src/EventSubscriber/LogSystem/LogAccessDeniedSubscriber.php @@ -35,7 +35,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; */ class LogAccessDeniedSubscriber implements EventSubscriberInterface { - private $logger; + private EventLogger $logger; public function __construct(EventLogger $logger) { diff --git a/src/EventSubscriber/LogSystem/LogDBMigrationSubscriber.php b/src/EventSubscriber/LogSystem/LogDBMigrationSubscriber.php index ee6f5c3c..e9ae66c6 100644 --- a/src/EventSubscriber/LogSystem/LogDBMigrationSubscriber.php +++ b/src/EventSubscriber/LogSystem/LogDBMigrationSubscriber.php @@ -54,11 +54,11 @@ use Doctrine\Migrations\Events; */ class LogDBMigrationSubscriber implements EventSubscriber { - protected $old_version = null; - protected $new_version = null; + protected ?string $old_version = null; + protected ?string $new_version = null; - protected $eventLogger; - protected $dependencyFactory; + protected EventLogger $eventLogger; + protected DependencyFactory $dependencyFactory; public function __construct(EventLogger $eventLogger, DependencyFactory $dependencyFactory) { diff --git a/src/EventSubscriber/LogSystem/LogoutLoggerListener.php b/src/EventSubscriber/LogSystem/LogoutLoggerListener.php index 7b0cacc3..2dbd7c1a 100644 --- a/src/EventSubscriber/LogSystem/LogoutLoggerListener.php +++ b/src/EventSubscriber/LogSystem/LogoutLoggerListener.php @@ -52,8 +52,8 @@ use Symfony\Component\Security\Http\Event\LogoutEvent; */ class LogoutLoggerListener { - protected $logger; - protected $gpdr_compliance; + protected EventLogger $logger; + protected bool $gpdr_compliance; public function __construct(EventLogger $logger, bool $gpdr_compliance) { diff --git a/src/EventSubscriber/LogSystem/SecurityEventLoggerSubscriber.php b/src/EventSubscriber/LogSystem/SecurityEventLoggerSubscriber.php index e6cd54f2..78d3a344 100644 --- a/src/EventSubscriber/LogSystem/SecurityEventLoggerSubscriber.php +++ b/src/EventSubscriber/LogSystem/SecurityEventLoggerSubscriber.php @@ -35,9 +35,9 @@ use Symfony\Component\HttpFoundation\RequestStack; */ final class SecurityEventLoggerSubscriber implements EventSubscriberInterface { - private $requestStack; - private $gpdr_compliant; - private $eventLogger; + private RequestStack $requestStack; + private bool $gpdr_compliant; + private EventLogger $eventLogger; public function __construct(RequestStack $requestStack, EventLogger $eventLogger, bool $gpdr_compliance) { diff --git a/src/EventSubscriber/SetMailFromSubscriber.php b/src/EventSubscriber/SetMailFromSubscriber.php index 942694d3..ec40e4a8 100644 --- a/src/EventSubscriber/SetMailFromSubscriber.php +++ b/src/EventSubscriber/SetMailFromSubscriber.php @@ -52,8 +52,8 @@ use Symfony\Component\Mime\Email; */ final class SetMailFromSubscriber implements EventSubscriberInterface { - private $email; - private $name; + private string $email; + private string $name; public function __construct(string $email, string $name) { diff --git a/src/EventSubscriber/SymfonyDebugToolbarSubscriber.php b/src/EventSubscriber/SymfonyDebugToolbarSubscriber.php index f66976b3..2fb7406e 100644 --- a/src/EventSubscriber/SymfonyDebugToolbarSubscriber.php +++ b/src/EventSubscriber/SymfonyDebugToolbarSubscriber.php @@ -50,7 +50,7 @@ use Symfony\Component\HttpKernel\Event\ResponseEvent; */ final class SymfonyDebugToolbarSubscriber implements EventSubscriberInterface { - private $kernel_debug; + private bool $kernel_debug; public function __construct(bool $kernel_debug) { diff --git a/src/EventSubscriber/UserSystem/LoginSuccessSubscriber.php b/src/EventSubscriber/UserSystem/LoginSuccessSubscriber.php index 89860613..2de197a4 100644 --- a/src/EventSubscriber/UserSystem/LoginSuccessSubscriber.php +++ b/src/EventSubscriber/UserSystem/LoginSuccessSubscriber.php @@ -46,6 +46,7 @@ use App\Entity\LogSystem\UserLoginLogEntry; use App\Entity\UserSystem\User; use App\Services\LogSystem\EventLogger; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; @@ -57,10 +58,10 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final class LoginSuccessSubscriber implements EventSubscriberInterface { - private $translator; - private $flashBag; - private $eventLogger; - private $gpdr_compliance; + private TranslatorInterface $translator; + private FlashBagInterface $flashBag; + private EventLogger $eventLogger; + private bool $gpdr_compliance; public function __construct(TranslatorInterface $translator, SessionInterface $session, EventLogger $eventLogger, bool $gpdr_compliance) { diff --git a/src/EventSubscriber/UserSystem/LogoutDisabledUserSubscriber.php b/src/EventSubscriber/UserSystem/LogoutDisabledUserSubscriber.php index a37946f6..019efa0e 100644 --- a/src/EventSubscriber/UserSystem/LogoutDisabledUserSubscriber.php +++ b/src/EventSubscriber/UserSystem/LogoutDisabledUserSubscriber.php @@ -56,8 +56,8 @@ use Symfony\Component\Security\Core\Security; */ final class LogoutDisabledUserSubscriber implements EventSubscriberInterface { - private $security; - private $urlGenerator; + private Security $security; + private UrlGeneratorInterface $urlGenerator; public function __construct(Security $security, UrlGeneratorInterface $urlGenerator) { diff --git a/src/EventSubscriber/UserSystem/PasswordChangeNeededSubscriber.php b/src/EventSubscriber/UserSystem/PasswordChangeNeededSubscriber.php index 9354ed25..7bb6e667 100644 --- a/src/EventSubscriber/UserSystem/PasswordChangeNeededSubscriber.php +++ b/src/EventSubscriber/UserSystem/PasswordChangeNeededSubscriber.php @@ -44,6 +44,7 @@ namespace App\EventSubscriber\UserSystem; use App\Entity\UserSystem\User; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpKernel\Event\RequestEvent; @@ -74,9 +75,9 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface * @var string The route the user will redirected to, if he needs to change this password */ public const REDIRECT_TARGET = 'user_settings'; - private $security; - private $flashBag; - private $httpUtils; + private Security $security; + private FlashBagInterface $flashBag; + private HttpUtils $httpUtils; public function __construct(Security $security, SessionInterface $session, HttpUtils $httpUtils) { diff --git a/src/EventSubscriber/UserSystem/RegisterU2FSubscriber.php b/src/EventSubscriber/UserSystem/RegisterU2FSubscriber.php index 17ab0a36..1efe9889 100644 --- a/src/EventSubscriber/UserSystem/RegisterU2FSubscriber.php +++ b/src/EventSubscriber/UserSystem/RegisterU2FSubscriber.php @@ -51,6 +51,7 @@ use R\U2FTwoFactorBundle\Event\RegisterEvent; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; @@ -61,19 +62,16 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; */ final class RegisterU2FSubscriber implements EventSubscriberInterface { - private $em; + private EntityManagerInterface $em; - private $demo_mode; - private $flashBag; - /** - * @var UrlGeneratorInterface - */ - private $router; + private bool $demo_mode; + private FlashBagInterface $flashBag; + private UrlGeneratorInterface $router; /** - * @var EventDispatcher|EventDispatcherInterface + * @var EventDispatcher */ - private $eventDispatcher; + private EventDispatcherInterface $eventDispatcher; public function __construct(UrlGeneratorInterface $router, EntityManagerInterface $entityManager, SessionInterface $session, EventDispatcherInterface $eventDispatcher, bool $demo_mode) { diff --git a/src/EventSubscriber/UserSystem/SetUserTimezoneSubscriber.php b/src/EventSubscriber/UserSystem/SetUserTimezoneSubscriber.php index f82fce11..a978b117 100644 --- a/src/EventSubscriber/UserSystem/SetUserTimezoneSubscriber.php +++ b/src/EventSubscriber/UserSystem/SetUserTimezoneSubscriber.php @@ -53,8 +53,8 @@ use Symfony\Component\Security\Core\Security; */ final class SetUserTimezoneSubscriber implements EventSubscriberInterface { - private $default_timezone; - private $security; + private string $default_timezone; + private Security $security; public function __construct(string $timezone, Security $security) { diff --git a/src/Events/SecurityEvent.php b/src/Events/SecurityEvent.php index a1198a46..262793ee 100644 --- a/src/Events/SecurityEvent.php +++ b/src/Events/SecurityEvent.php @@ -32,8 +32,7 @@ use Symfony\Contracts\EventDispatcher\Event; */ class SecurityEvent extends Event { - protected $targetUser; - protected $from_cli; + protected User $targetUser; public function __construct(User $targetUser) { diff --git a/src/Form/AdminPages/AttachmentTypeAdminForm.php b/src/Form/AdminPages/AttachmentTypeAdminForm.php index a8967e29..d81b34b7 100644 --- a/src/Form/AdminPages/AttachmentTypeAdminForm.php +++ b/src/Form/AdminPages/AttachmentTypeAdminForm.php @@ -51,7 +51,7 @@ use Symfony\Component\Security\Core\Security; class AttachmentTypeAdminForm extends BaseEntityAdminForm { - protected $filterTools; + protected FileTypeFilterTools $filterTools; public function __construct(Security $security, FileTypeFilterTools $filterTools) { diff --git a/src/Form/AdminPages/BaseEntityAdminForm.php b/src/Form/AdminPages/BaseEntityAdminForm.php index b97da09d..54437b82 100644 --- a/src/Form/AdminPages/BaseEntityAdminForm.php +++ b/src/Form/AdminPages/BaseEntityAdminForm.php @@ -64,7 +64,7 @@ use Symfony\Component\Security\Core\Security; class BaseEntityAdminForm extends AbstractType { - protected $security; + protected Security $security; public function __construct(Security $security) { diff --git a/src/Form/AdminPages/CurrencyAdminForm.php b/src/Form/AdminPages/CurrencyAdminForm.php index d32aea38..a53d05b3 100644 --- a/src/Form/AdminPages/CurrencyAdminForm.php +++ b/src/Form/AdminPages/CurrencyAdminForm.php @@ -51,7 +51,7 @@ use Symfony\Component\Security\Core\Security; class CurrencyAdminForm extends BaseEntityAdminForm { - private $default_currency; + private string $default_currency; public function __construct(Security $security, string $default_currency) { diff --git a/src/Form/AdminPages/ImportType.php b/src/Form/AdminPages/ImportType.php index 3f1c697c..69b9b4e1 100644 --- a/src/Form/AdminPages/ImportType.php +++ b/src/Form/AdminPages/ImportType.php @@ -55,7 +55,7 @@ use Symfony\Component\Security\Core\Security; class ImportType extends AbstractType { - protected $security; + protected Security $security; public function __construct(Security $security) { diff --git a/src/Form/AdminPages/MassCreationForm.php b/src/Form/AdminPages/MassCreationForm.php index 209e1fcc..7aca643e 100644 --- a/src/Form/AdminPages/MassCreationForm.php +++ b/src/Form/AdminPages/MassCreationForm.php @@ -52,7 +52,7 @@ use Symfony\Component\Security\Core\Security; class MassCreationForm extends AbstractType { - protected $security; + protected Security $security; public function __construct(Security $security) { diff --git a/src/Form/AdminPages/SupplierForm.php b/src/Form/AdminPages/SupplierForm.php index 61a5d6a4..5ee52a91 100644 --- a/src/Form/AdminPages/SupplierForm.php +++ b/src/Form/AdminPages/SupplierForm.php @@ -51,7 +51,7 @@ use Symfony\Component\Security\Core\Security; class SupplierForm extends CompanyForm { - protected $default_currency; + protected string $default_currency; public function __construct(Security $security, string $default_currency) { diff --git a/src/Form/AttachmentFormType.php b/src/Form/AttachmentFormType.php index 22368f46..2df31e20 100644 --- a/src/Form/AttachmentFormType.php +++ b/src/Form/AttachmentFormType.php @@ -67,12 +67,12 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AttachmentFormType extends AbstractType { - protected $attachment_helper; - protected $urlGenerator; - protected $allow_attachments_download; - protected $security; - protected $submitHandler; - protected $translator; + protected AttachmentManager $attachment_helper; + protected UrlGeneratorInterface $urlGenerator; + protected bool $allow_attachments_download; + protected Security $security; + protected AttachmentSubmitHandler $submitHandler; + protected TranslatorInterface $translator; public function __construct(AttachmentManager $attachmentHelper, UrlGeneratorInterface $urlGenerator, Security $security, diff --git a/src/Form/CollectionTypeExtension.php b/src/Form/CollectionTypeExtension.php index 1777a634..f3aa4143 100644 --- a/src/Form/CollectionTypeExtension.php +++ b/src/Form/CollectionTypeExtension.php @@ -45,7 +45,7 @@ use Symfony\Component\PropertyAccess\PropertyAccessorInterface; */ class CollectionTypeExtension extends AbstractTypeExtension { - protected $propertyAccess; + protected PropertyAccessorInterface $propertyAccess; public function __construct(PropertyAccessorInterface $propertyAccess) { diff --git a/src/Form/Filters/Constraints/InstanceOfConstraintType.php b/src/Form/Filters/Constraints/InstanceOfConstraintType.php index 666ae563..76c90e1a 100644 --- a/src/Form/Filters/Constraints/InstanceOfConstraintType.php +++ b/src/Form/Filters/Constraints/InstanceOfConstraintType.php @@ -11,7 +11,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class InstanceOfConstraintType extends AbstractType { - protected $em; + protected EntityManagerInterface $em; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Form/Filters/Constraints/TagsConstraintType.php b/src/Form/Filters/Constraints/TagsConstraintType.php index c5c9d043..3cb16b77 100644 --- a/src/Form/Filters/Constraints/TagsConstraintType.php +++ b/src/Form/Filters/Constraints/TagsConstraintType.php @@ -12,7 +12,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class TagsConstraintType extends AbstractType { - protected $urlGenerator; + protected UrlGeneratorInterface $urlGenerator; public function __construct(UrlGeneratorInterface $urlGenerator) { diff --git a/src/Form/LabelOptionsType.php b/src/Form/LabelOptionsType.php index 3a401a12..781702fa 100644 --- a/src/Form/LabelOptionsType.php +++ b/src/Form/LabelOptionsType.php @@ -35,7 +35,7 @@ use Symfony\Component\Security\Core\Security; class LabelOptionsType extends AbstractType { - private $security; + private Security $security; public function __construct(Security $security) { diff --git a/src/Form/LabelSystem/LabelDialogType.php b/src/Form/LabelSystem/LabelDialogType.php index 472f708d..ee75c143 100644 --- a/src/Form/LabelSystem/LabelDialogType.php +++ b/src/Form/LabelSystem/LabelDialogType.php @@ -34,7 +34,7 @@ use Symfony\Component\Security\Core\Security; class LabelDialogType extends AbstractType { - protected $security; + protected Security $security; public function __construct(Security $security) { diff --git a/src/Form/Part/OrderdetailType.php b/src/Form/Part/OrderdetailType.php index 81f4fdd5..65dbde86 100644 --- a/src/Form/Part/OrderdetailType.php +++ b/src/Form/Part/OrderdetailType.php @@ -60,7 +60,7 @@ use Symfony\Component\Security\Core\Security; class OrderdetailType extends AbstractType { - protected $security; + protected Security $security; public function __construct(Security $security) { diff --git a/src/Form/Part/PartBaseType.php b/src/Form/Part/PartBaseType.php index 64df35b6..fba54dfb 100644 --- a/src/Form/Part/PartBaseType.php +++ b/src/Form/Part/PartBaseType.php @@ -72,9 +72,8 @@ use Symfony\Component\Security\Core\Security; class PartBaseType extends AbstractType { - protected $security; - protected $trans; - protected $urlGenerator; + protected Security $security; + protected UrlGeneratorInterface $urlGenerator; public function __construct(Security $security, UrlGeneratorInterface $urlGenerator) { diff --git a/src/Form/Part/PartLotType.php b/src/Form/Part/PartLotType.php index 304d6167..9d1c63b1 100644 --- a/src/Form/Part/PartLotType.php +++ b/src/Form/Part/PartLotType.php @@ -57,7 +57,7 @@ use Symfony\Component\Security\Core\Security; class PartLotType extends AbstractType { - protected $security; + protected Security $security; public function __construct(Security $security) { diff --git a/src/Form/Permissions/PermissionGroupType.php b/src/Form/Permissions/PermissionGroupType.php index 0a0e5d9f..ee8ba628 100644 --- a/src/Form/Permissions/PermissionGroupType.php +++ b/src/Form/Permissions/PermissionGroupType.php @@ -50,8 +50,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PermissionGroupType extends AbstractType { - protected $resolver; - protected $perm_structure; + protected PermissionResolver $resolver; + protected array $perm_structure; public function __construct(PermissionResolver $resolver) { diff --git a/src/Form/Permissions/PermissionType.php b/src/Form/Permissions/PermissionType.php index 4da75c3e..d733417e 100644 --- a/src/Form/Permissions/PermissionType.php +++ b/src/Form/Permissions/PermissionType.php @@ -53,8 +53,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PermissionType extends AbstractType { - protected $resolver; - protected $perm_structure; + protected PermissionResolver $resolver; + protected array $perm_structure; public function __construct(PermissionResolver $resolver) { diff --git a/src/Form/Permissions/PermissionsMapper.php b/src/Form/Permissions/PermissionsMapper.php index 657c68ea..6f637c3c 100644 --- a/src/Form/Permissions/PermissionsMapper.php +++ b/src/Form/Permissions/PermissionsMapper.php @@ -54,8 +54,8 @@ use Traversable; */ final class PermissionsMapper implements DataMapperInterface { - private $resolver; - private $inherit; + private PermissionResolver $resolver; + private bool $inherit; public function __construct(PermissionResolver $resolver, bool $inherit = false) { diff --git a/src/Form/Permissions/PermissionsType.php b/src/Form/Permissions/PermissionsType.php index 59c25d88..b16e76e4 100644 --- a/src/Form/Permissions/PermissionsType.php +++ b/src/Form/Permissions/PermissionsType.php @@ -53,8 +53,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PermissionsType extends AbstractType { - protected $resolver; - protected $perm_structure; + protected PermissionResolver $resolver; + protected array $perm_structure; public function __construct(PermissionResolver $resolver) { diff --git a/src/Form/TFAGoogleSettingsType.php b/src/Form/TFAGoogleSettingsType.php index be0d99ed..c4cded13 100644 --- a/src/Form/TFAGoogleSettingsType.php +++ b/src/Form/TFAGoogleSettingsType.php @@ -55,7 +55,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class TFAGoogleSettingsType extends AbstractType { - protected $translator; public function __construct() { diff --git a/src/Form/Type/CurrencyEntityType.php b/src/Form/Type/CurrencyEntityType.php index e1f8cf84..4be7c402 100644 --- a/src/Form/Type/CurrencyEntityType.php +++ b/src/Form/Type/CurrencyEntityType.php @@ -57,9 +57,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class CurrencyEntityType extends StructuralEntityType { - protected $base_currency; + protected ?string $base_currency; - public function __construct(EntityManagerInterface $em, NodesListBuilder $builder, $base_currency) + public function __construct(EntityManagerInterface $em, NodesListBuilder $builder, ?string $base_currency) { parent::__construct($em, $builder); $this->base_currency = $base_currency; diff --git a/src/Form/Type/SIUnitType.php b/src/Form/Type/SIUnitType.php index ba1dc7f4..eab46e2a 100644 --- a/src/Form/Type/SIUnitType.php +++ b/src/Form/Type/SIUnitType.php @@ -58,7 +58,7 @@ use Traversable; final class SIUnitType extends AbstractType implements DataMapperInterface { - protected $si_formatter; + protected SIFormatter $si_formatter; public function __construct(SIFormatter $SIFormatter) { diff --git a/src/Form/Type/StructuralEntityType.php b/src/Form/Type/StructuralEntityType.php index dd233d18..7ef5f8ed 100644 --- a/src/Form/Type/StructuralEntityType.php +++ b/src/Form/Type/StructuralEntityType.php @@ -63,7 +63,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class StructuralEntityType extends AbstractType { - protected $em; + protected EntityManagerInterface $em; /** * @var NodesListBuilder diff --git a/src/Form/UserAdminForm.php b/src/Form/UserAdminForm.php index 6a5eaa4c..2c3d07c7 100644 --- a/src/Form/UserAdminForm.php +++ b/src/Form/UserAdminForm.php @@ -67,7 +67,7 @@ use Symfony\Component\Validator\Constraints\Length; class UserAdminForm extends AbstractType { - protected $security; + protected Security $security; public function __construct(Security $security) { diff --git a/src/Form/UserSettingsType.php b/src/Form/UserSettingsType.php index fa67f5fe..ca4b4275 100644 --- a/src/Form/UserSettingsType.php +++ b/src/Form/UserSettingsType.php @@ -58,8 +58,8 @@ use Symfony\Component\Security\Core\Security; class UserSettingsType extends AbstractType { - protected $security; - protected $demo_mode; + protected Security $security; + protected bool $demo_mode; public function __construct(Security $security, bool $demo_mode) { diff --git a/src/Helpers/BBCodeToMarkdownConverter.php b/src/Helpers/BBCodeToMarkdownConverter.php index b656751f..0bcc1b9f 100644 --- a/src/Helpers/BBCodeToMarkdownConverter.php +++ b/src/Helpers/BBCodeToMarkdownConverter.php @@ -48,7 +48,7 @@ use SebastianBergmann\CodeCoverage\Report\Text; class BBCodeToMarkdownConverter { - protected $html_to_markdown; + protected HtmlConverter $html_to_markdown; public function __construct() { diff --git a/src/Helpers/UTCDateTimeType.php b/src/Helpers/UTCDateTimeType.php index 73e83f2b..4bfd587d 100644 --- a/src/Helpers/UTCDateTimeType.php +++ b/src/Helpers/UTCDateTimeType.php @@ -54,7 +54,7 @@ use Doctrine\DBAL\Types\DateTimeType; */ class UTCDateTimeType extends DateTimeType { - private static $utc_timezone; + private static ?DateTimeZone $utc_timezone = null; public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string { diff --git a/src/Migration/AbstractMultiPlatformMigration.php b/src/Migration/AbstractMultiPlatformMigration.php index 7c7fdb68..39170077 100644 --- a/src/Migration/AbstractMultiPlatformMigration.php +++ b/src/Migration/AbstractMultiPlatformMigration.php @@ -19,10 +19,10 @@ abstract class AbstractMultiPlatformMigration extends AbstractMigration { public const ADMIN_PW_LENGTH = 10; - protected $permissions_updated = false; - protected $admin_pw = ''; + protected bool $permissions_updated = false; + protected string $admin_pw = ''; - protected $logger; + protected LoggerInterface $logger; public function __construct(Connection $connection, LoggerInterface $logger) { diff --git a/src/Security/Annotations/ColumnSecurity.php b/src/Security/Annotations/ColumnSecurity.php index dab6a5a5..dcc8881b 100644 --- a/src/Security/Annotations/ColumnSecurity.php +++ b/src/Security/Annotations/ColumnSecurity.php @@ -62,19 +62,19 @@ class ColumnSecurity /** * @var string The name of the edit permission */ - public $edit = 'edit'; + public string $edit = 'edit'; /** * @var string The name of the read permission */ - public $read = 'read'; + public string $read = 'read'; /** * @var string A prefix for all permission names (e.g..edit, useful for Parts) */ - public $prefix = ''; + public string $prefix = ''; /** - * @var string the placeholder that should be used, when the access to the property is denied + * @var mixed the placeholder that should be used, when the access to the property is denied */ public $placeholder = null; diff --git a/src/Security/EntityListeners/ElementPermissionListener.php b/src/Security/EntityListeners/ElementPermissionListener.php index 30a17782..d9a8d90d 100644 --- a/src/Security/EntityListeners/ElementPermissionListener.php +++ b/src/Security/EntityListeners/ElementPermissionListener.php @@ -68,12 +68,12 @@ use Symfony\Component\Security\Core\Security; */ class ElementPermissionListener { - protected $security; - protected $reader; - protected $em; - protected $disabled; + protected Security $security; + protected Reader $reader; + protected EntityManagerInterface $em; + protected bool $disabled; - protected $perm_cache; + protected array $perm_cache; public function __construct(Security $security, Reader $reader, EntityManagerInterface $em) { diff --git a/src/Security/Voter/ExtendedVoter.php b/src/Security/Voter/ExtendedVoter.php index 279e9d63..c7683efe 100644 --- a/src/Security/Voter/ExtendedVoter.php +++ b/src/Security/Voter/ExtendedVoter.php @@ -54,11 +54,8 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; */ abstract class ExtendedVoter extends Voter { - protected $entityManager; - /** - * @var PermissionResolver - */ - protected $resolver; + protected EntityManagerInterface $entityManager; + protected PermissionResolver $resolver; public function __construct(PermissionResolver $resolver, EntityManagerInterface $entityManager) { diff --git a/src/Services/AmountFormatter.php b/src/Services/AmountFormatter.php index 26cd26d9..afbec460 100644 --- a/src/Services/AmountFormatter.php +++ b/src/Services/AmountFormatter.php @@ -52,7 +52,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class AmountFormatter { - protected $siFormatter; + protected SIFormatter $siFormatter; public function __construct(SIFormatter $siFormatter) { diff --git a/src/Services/Attachments/AttachmentManager.php b/src/Services/Attachments/AttachmentManager.php index dccaa781..7ad0a9bd 100644 --- a/src/Services/Attachments/AttachmentManager.php +++ b/src/Services/Attachments/AttachmentManager.php @@ -55,7 +55,7 @@ use function strlen; */ class AttachmentManager { - protected $pathResolver; + protected AttachmentPathResolver $pathResolver; public function __construct(AttachmentPathResolver $pathResolver) { diff --git a/src/Services/Attachments/AttachmentPathResolver.php b/src/Services/Attachments/AttachmentPathResolver.php index 63af13e9..112fe58b 100644 --- a/src/Services/Attachments/AttachmentPathResolver.php +++ b/src/Services/Attachments/AttachmentPathResolver.php @@ -51,17 +51,17 @@ use Symfony\Component\Filesystem\Filesystem; */ class AttachmentPathResolver { - protected $project_dir; + protected string $project_dir; - protected $media_path; - protected $footprints_path; - protected $models_path; - protected $secure_path; + protected ?string $media_path; + protected ?string $footprints_path; + protected ?string $models_path; + protected ?string $secure_path; - protected $placeholders; - protected $pathes; - protected $placeholders_regex; - protected $pathes_regex; + protected array $placeholders; + protected array $pathes; + protected array $placeholders_regex; + protected array $pathes_regex; /** * AttachmentPathResolver constructor. diff --git a/src/Services/Attachments/AttachmentReverseSearch.php b/src/Services/Attachments/AttachmentReverseSearch.php index 50d23912..4b32bdb0 100644 --- a/src/Services/Attachments/AttachmentReverseSearch.php +++ b/src/Services/Attachments/AttachmentReverseSearch.php @@ -54,10 +54,10 @@ use Symfony\Component\Filesystem\Filesystem; */ class AttachmentReverseSearch { - protected $em; - protected $pathResolver; - protected $cacheManager; - protected $attachmentURLGenerator; + protected EntityManagerInterface $em; + protected AttachmentPathResolver $pathResolver; + protected CacheManager $cacheManager; + protected AttachmentURLGenerator $attachmentURLGenerator; public function __construct(EntityManagerInterface $em, AttachmentPathResolver $pathResolver, CacheManager $cacheManager, AttachmentURLGenerator $attachmentURLGenerator) diff --git a/src/Services/Attachments/AttachmentSubmitHandler.php b/src/Services/Attachments/AttachmentSubmitHandler.php index a748494e..7af43d30 100644 --- a/src/Services/Attachments/AttachmentSubmitHandler.php +++ b/src/Services/Attachments/AttachmentSubmitHandler.php @@ -74,12 +74,12 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; */ class AttachmentSubmitHandler { - protected $pathResolver; - protected $folder_mapping; - protected $allow_attachments_downloads; - protected $httpClient; - protected $mimeTypes; - protected $filterTools; + protected AttachmentPathResolver $pathResolver; + protected array $folder_mapping; + protected bool $allow_attachments_downloads; + protected HttpClientInterface $httpClient; + protected MimeTypesInterface $mimeTypes; + protected FileTypeFilterTools $filterTools; public function __construct(AttachmentPathResolver $pathResolver, bool $allow_attachments_downloads, HttpClientInterface $httpClient, MimeTypesInterface $mimeTypes, diff --git a/src/Services/Attachments/AttachmentURLGenerator.php b/src/Services/Attachments/AttachmentURLGenerator.php index eb189df9..617da62f 100644 --- a/src/Services/Attachments/AttachmentURLGenerator.php +++ b/src/Services/Attachments/AttachmentURLGenerator.php @@ -53,14 +53,14 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class AttachmentURLGenerator { - protected $assets; - protected $public_path; - protected $pathResolver; - protected $urlGenerator; - protected $attachmentHelper; - protected $filterService; + protected Packages $assets; + protected string $public_path; + protected AttachmentPathResolver $pathResolver; + protected UrlGeneratorInterface $urlGenerator; + protected AttachmentManager $attachmentHelper; + protected FilterService $filterService; - protected $logger; + protected LoggerInterface $logger; public function __construct(Packages $assets, AttachmentPathResolver $pathResolver, UrlGeneratorInterface $urlGenerator, AttachmentManager $attachmentHelper, diff --git a/src/Services/Attachments/BuiltinAttachmentsFinder.php b/src/Services/Attachments/BuiltinAttachmentsFinder.php index 92df4a9f..bd1495d9 100644 --- a/src/Services/Attachments/BuiltinAttachmentsFinder.php +++ b/src/Services/Attachments/BuiltinAttachmentsFinder.php @@ -53,8 +53,8 @@ use Symfony\Contracts\Cache\CacheInterface; */ class BuiltinAttachmentsFinder { - protected $pathResolver; - protected $cache; + protected AttachmentPathResolver $pathResolver; + protected CacheInterface $cache; public function __construct(CacheInterface $cache, AttachmentPathResolver $pathResolver) { diff --git a/src/Services/Attachments/FileTypeFilterTools.php b/src/Services/Attachments/FileTypeFilterTools.php index 49a2157e..6fa2aada 100644 --- a/src/Services/Attachments/FileTypeFilterTools.php +++ b/src/Services/Attachments/FileTypeFilterTools.php @@ -63,8 +63,8 @@ class FileTypeFilterTools protected const AUDIO_EXTS = ['mp3', 'flac', 'ogg', 'oga', 'wav', 'm4a', 'opus']; protected const ALLOWED_MIME_PLACEHOLDERS = ['image/*', 'audio/*', 'video/*']; - protected $mimeTypes; - protected $cache; + protected MimeTypesInterface $mimeTypes; + protected CacheInterface $cache; public function __construct(MimeTypesInterface $mimeTypes, CacheInterface $cache) { diff --git a/src/Services/Attachments/PartPreviewGenerator.php b/src/Services/Attachments/PartPreviewGenerator.php index 45b33a15..1b8eaca6 100644 --- a/src/Services/Attachments/PartPreviewGenerator.php +++ b/src/Services/Attachments/PartPreviewGenerator.php @@ -47,7 +47,7 @@ use App\Entity\Parts\Part; class PartPreviewGenerator { - protected $attachmentHelper; + protected AttachmentManager $attachmentHelper; public function __construct(AttachmentManager $attachmentHelper) { diff --git a/src/Services/ElementTypeNameGenerator.php b/src/Services/ElementTypeNameGenerator.php index 9d4d3f4d..ccf7247c 100644 --- a/src/Services/ElementTypeNameGenerator.php +++ b/src/Services/ElementTypeNameGenerator.php @@ -67,8 +67,8 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ElementTypeNameGenerator { - protected $translator; - protected $mapping; + protected TranslatorInterface $translator; + protected array $mapping; public function __construct(TranslatorInterface $translator) { diff --git a/src/Services/EntityExporter.php b/src/Services/EntityExporter.php index 8d6d6cde..948c0f55 100644 --- a/src/Services/EntityExporter.php +++ b/src/Services/EntityExporter.php @@ -58,7 +58,7 @@ use Symfony\Component\Serializer\SerializerInterface; */ class EntityExporter { - protected $serializer; + protected SerializerInterface $serializer; public function __construct(SerializerInterface $serializer) { diff --git a/src/Services/EntityImporter.php b/src/Services/EntityImporter.php index 577282c5..843585ed 100644 --- a/src/Services/EntityImporter.php +++ b/src/Services/EntityImporter.php @@ -54,9 +54,9 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; class EntityImporter { - protected $serializer; - protected $em; - protected $validator; + protected SerializerInterface $serializer; + protected EntityManagerInterface $em; + protected ValidatorInterface $validator; public function __construct(SerializerInterface $serializer, EntityManagerInterface $em, ValidatorInterface $validator) { diff --git a/src/Services/EntityURLGenerator.php b/src/Services/EntityURLGenerator.php index 49f8c2d1..cb3eee81 100644 --- a/src/Services/EntityURLGenerator.php +++ b/src/Services/EntityURLGenerator.php @@ -76,11 +76,8 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; */ class EntityURLGenerator { - protected $attachmentURLGenerator; - /** - * @var UrlGeneratorInterface - */ - protected $urlGenerator; + protected UrlGeneratorInterface $urlGenerator; + protected AttachmentURLGenerator $attachmentURLGenerator; public function __construct(UrlGeneratorInterface $urlGenerator, AttachmentURLGenerator $attachmentURLGenerator) { diff --git a/src/Services/ExchangeRateUpdater.php b/src/Services/ExchangeRateUpdater.php index 008d1ed5..9f913526 100644 --- a/src/Services/ExchangeRateUpdater.php +++ b/src/Services/ExchangeRateUpdater.php @@ -8,8 +8,8 @@ use Swap\Swap; class ExchangeRateUpdater { - private $base_currency; - private $swap; + private string $base_currency; + private Swap $swap; public function __construct(string $base_currency, Swap $swap) { diff --git a/src/Services/GitVersionInfo.php b/src/Services/GitVersionInfo.php index f80eff86..6cac06f7 100644 --- a/src/Services/GitVersionInfo.php +++ b/src/Services/GitVersionInfo.php @@ -46,7 +46,7 @@ use Symfony\Component\HttpKernel\KernelInterface; class GitVersionInfo { - protected $project_dir; + protected string $project_dir; public function __construct(KernelInterface $kernel) { diff --git a/src/Services/LabelSystem/BarcodeGenerator.php b/src/Services/LabelSystem/BarcodeGenerator.php index 62505fbc..7e8a4f7f 100644 --- a/src/Services/LabelSystem/BarcodeGenerator.php +++ b/src/Services/LabelSystem/BarcodeGenerator.php @@ -30,7 +30,7 @@ use InvalidArgumentException; final class BarcodeGenerator { - private $barcodeContentGenerator; + private BarcodeContentGenerator $barcodeContentGenerator; public function __construct(BarcodeContentGenerator $barcodeContentGenerator) { diff --git a/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php b/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php index 80043ac5..b430f767 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeContentGenerator.php @@ -43,7 +43,8 @@ final class BarcodeContentGenerator PartLot::class => 'lot', Storelocation::class => 'location', ]; - private $urlGenerator; + + private UrlGeneratorInterface $urlGenerator; public function __construct(UrlGeneratorInterface $urlGenerator) { diff --git a/src/Services/LabelSystem/Barcodes/BarcodeRedirector.php b/src/Services/LabelSystem/Barcodes/BarcodeRedirector.php index 028909df..8fbc24f7 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeRedirector.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeRedirector.php @@ -31,8 +31,8 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; final class BarcodeRedirector { - private $urlGenerator; - private $em; + private UrlGeneratorInterface $urlGenerator; + private EntityManagerInterface $em; public function __construct(UrlGeneratorInterface $urlGenerator, EntityManagerInterface $entityManager) { diff --git a/src/Services/LabelSystem/LabelGenerator.php b/src/Services/LabelSystem/LabelGenerator.php index 4fc85db7..37ff4c3b 100644 --- a/src/Services/LabelSystem/LabelGenerator.php +++ b/src/Services/LabelSystem/LabelGenerator.php @@ -40,7 +40,7 @@ final class LabelGenerator public const MM_TO_POINTS_FACTOR = 2.83465; - private $labelHTMLGenerator; + private LabelHTMLGenerator $labelHTMLGenerator; public function __construct(LabelHTMLGenerator $labelHTMLGenerator) { diff --git a/src/Services/LabelSystem/LabelHTMLGenerator.php b/src/Services/LabelSystem/LabelHTMLGenerator.php index 49ff0d1e..59476314 100644 --- a/src/Services/LabelSystem/LabelHTMLGenerator.php +++ b/src/Services/LabelSystem/LabelHTMLGenerator.php @@ -34,13 +34,13 @@ use Twig\Error\Error; final class LabelHTMLGenerator { - private $twig; - private $elementTypeNameGenerator; - private $replacer; - private $barcodeGenerator; - private $sandboxedTwigProvider; - private $partdb_title; - private $security; + private Environment $twig; + private ElementTypeNameGenerator $elementTypeNameGenerator; + private LabelTextReplacer $replacer; + private BarcodeGenerator $barcodeGenerator; + private SandboxedTwigProvider $sandboxedTwigProvider; + private string $partdb_title; + private Security $security; public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, LabelTextReplacer $replacer, Environment $twig, BarcodeGenerator $barcodeGenerator, SandboxedTwigProvider $sandboxedTwigProvider, Security $security, string $partdb_title) diff --git a/src/Services/LabelSystem/LabelProfileDropdownHelper.php b/src/Services/LabelSystem/LabelProfileDropdownHelper.php index 6dc116f9..148cb1fa 100644 --- a/src/Services/LabelSystem/LabelProfileDropdownHelper.php +++ b/src/Services/LabelSystem/LabelProfileDropdownHelper.php @@ -32,9 +32,9 @@ use Symfony\Contracts\Cache\TagAwareCacheInterface; final class LabelProfileDropdownHelper { - private $cache; - private $entityManager; - private $keyGenerator; + private TagAwareCacheInterface $cache; + private EntityManagerInterface $entityManager; + private UserCacheKeyGenerator $keyGenerator; public function __construct(TagAwareCacheInterface $treeCache, EntityManagerInterface $entityManager, UserCacheKeyGenerator $keyGenerator) { diff --git a/src/Services/LabelSystem/LabelTextReplacer.php b/src/Services/LabelSystem/LabelTextReplacer.php index de90bb38..be09e8bd 100644 --- a/src/Services/LabelSystem/LabelTextReplacer.php +++ b/src/Services/LabelSystem/LabelTextReplacer.php @@ -31,7 +31,7 @@ use App\Services\LabelSystem\PlaceholderProviders\PlaceholderProviderInterface; */ final class LabelTextReplacer { - private $providers; + private iterable $providers; public function __construct(iterable $providers) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/AbstractDBElementProvider.php b/src/Services/LabelSystem/PlaceholderProviders/AbstractDBElementProvider.php index 734edcf9..74c93d5d 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/AbstractDBElementProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/AbstractDBElementProvider.php @@ -28,7 +28,7 @@ use App\Services\ElementTypeNameGenerator; final class AbstractDBElementProvider implements PlaceholderProviderInterface { - private $elementTypeNameGenerator; + private ElementTypeNameGenerator $elementTypeNameGenerator; public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php b/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php index 66ddad6b..813595aa 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php +++ b/src/Services/LabelSystem/PlaceholderProviders/GlobalProviders.php @@ -34,8 +34,8 @@ use Symfony\Component\Security\Core\Security; */ final class GlobalProviders implements PlaceholderProviderInterface { - private $partdb_title; - private $security; + private string $partdb_title; + private Security $security; public function __construct(string $partdb_title, Security $security) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php b/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php index d9137547..54e5a375 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/PartLotProvider.php @@ -31,8 +31,8 @@ use Locale; final class PartLotProvider implements PlaceholderProviderInterface { - private $labelTextReplacer; - private $amountFormatter; + private LabelTextReplacer $labelTextReplacer; + private AmountFormatter $amountFormatter; public function __construct(LabelTextReplacer $labelTextReplacer, AmountFormatter $amountFormatter) { diff --git a/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php b/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php index 3d3fe1a9..0b6f3777 100644 --- a/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php +++ b/src/Services/LabelSystem/PlaceholderProviders/PartProvider.php @@ -30,8 +30,8 @@ use Symfony\Contracts\Translation\TranslatorInterface; final class PartProvider implements PlaceholderProviderInterface { - private $siFormatter; - private $translator; + private SIFormatter $siFormatter; + private TranslatorInterface $translator; public function __construct(SIFormatter $SIFormatter, TranslatorInterface $translator) { diff --git a/src/Services/LabelSystem/SandboxedTwigProvider.php b/src/Services/LabelSystem/SandboxedTwigProvider.php index 574e8533..d3096f41 100644 --- a/src/Services/LabelSystem/SandboxedTwigProvider.php +++ b/src/Services/LabelSystem/SandboxedTwigProvider.php @@ -96,7 +96,7 @@ final class SandboxedTwigProvider ]; private const ALLOWED_PROPERTIES = []; - private $appExtension; + private FormatExtension $appExtension; public function __construct(FormatExtension $appExtension) { diff --git a/src/Services/LogSystem/EventCommentHelper.php b/src/Services/LogSystem/EventCommentHelper.php index 92cf978b..6391bdf6 100644 --- a/src/Services/LogSystem/EventCommentHelper.php +++ b/src/Services/LogSystem/EventCommentHelper.php @@ -27,7 +27,7 @@ class EventCommentHelper { protected const MAX_MESSAGE_LENGTH = 255; - protected $message; + protected ?string $message; public function __construct() { diff --git a/src/Services/LogSystem/EventLogger.php b/src/Services/LogSystem/EventLogger.php index 7a90e9a4..643bd038 100644 --- a/src/Services/LogSystem/EventLogger.php +++ b/src/Services/LogSystem/EventLogger.php @@ -49,11 +49,11 @@ use Symfony\Component\Security\Core\Security; class EventLogger { - protected $minimum_log_level; - protected $blacklist; - protected $whitelist; - protected $em; - protected $security; + protected int $minimum_log_level; + protected array $blacklist; + protected array $whitelist; + protected EntityManagerInterface $em; + protected Security $security; public function __construct(int $minimum_log_level, array $blacklist, array $whitelist, EntityManagerInterface $em, Security $security) { diff --git a/src/Services/LogSystem/EventUndoHelper.php b/src/Services/LogSystem/EventUndoHelper.php index 4366325d..d3978d0b 100644 --- a/src/Services/LogSystem/EventUndoHelper.php +++ b/src/Services/LogSystem/EventUndoHelper.php @@ -33,8 +33,8 @@ class EventUndoHelper protected const ALLOWED_MODES = [self::MODE_REVERT, self::MODE_UNDO]; - protected $undone_event; - protected $mode; + protected ?AbstractLogEntry $undone_event; + protected string $mode; public function __construct() { diff --git a/src/Services/LogSystem/LogEntryExtraFormatter.php b/src/Services/LogSystem/LogEntryExtraFormatter.php index 08607968..92568035 100644 --- a/src/Services/LogSystem/LogEntryExtraFormatter.php +++ b/src/Services/LogSystem/LogEntryExtraFormatter.php @@ -66,8 +66,8 @@ class LogEntryExtraFormatter { protected const CONSOLE_SEARCH = ['', '', '', '', '']; protected const CONSOLE_REPLACE = ['→', '', '', '', '']; - protected $translator; - protected $elementTypeNameGenerator; + protected TranslatorInterface $translator; + protected ElementTypeNameGenerator $elementTypeNameGenerator; public function __construct(TranslatorInterface $translator, ElementTypeNameGenerator $elementTypeNameGenerator) { diff --git a/src/Services/LogSystem/TimeTravel.php b/src/Services/LogSystem/TimeTravel.php index 66a5944c..6c61a67c 100644 --- a/src/Services/LogSystem/TimeTravel.php +++ b/src/Services/LogSystem/TimeTravel.php @@ -32,6 +32,7 @@ use App\Entity\Contracts\TimeTravelInterface; use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\LogSystem\CollectionElementDeleted; use App\Entity\LogSystem\ElementEditedLogEntry; +use App\Repository\LogEntryRepository; use Brick\Math\BigDecimal; use DateTime; use Doctrine\Common\Collections\Collection; @@ -44,8 +45,8 @@ use ReflectionClass; class TimeTravel { - protected $em; - protected $repo; + protected EntityManagerInterface $em; + protected LogEntryRepository $repo; public function __construct(EntityManagerInterface $em) { diff --git a/src/Services/MarkdownParser.php b/src/Services/MarkdownParser.php index fc25b1ad..076807a5 100644 --- a/src/Services/MarkdownParser.php +++ b/src/Services/MarkdownParser.php @@ -49,7 +49,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class MarkdownParser { - protected $translator; + protected TranslatorInterface $translator; public function __construct(TranslatorInterface $translator) { diff --git a/src/Services/MoneyFormatter.php b/src/Services/MoneyFormatter.php index 95602ed2..9a4cf787 100644 --- a/src/Services/MoneyFormatter.php +++ b/src/Services/MoneyFormatter.php @@ -48,8 +48,8 @@ use NumberFormatter; class MoneyFormatter { - protected $base_currency; - protected $locale; + protected string $base_currency; + protected string $locale; public function __construct(string $base_currency) { diff --git a/src/Services/Parts/PartsTableActionHandler.php b/src/Services/Parts/PartsTableActionHandler.php index e9d38f62..a30bd9d2 100644 --- a/src/Services/Parts/PartsTableActionHandler.php +++ b/src/Services/Parts/PartsTableActionHandler.php @@ -34,8 +34,8 @@ use Symfony\Component\Security\Core\Security; final class PartsTableActionHandler { - private $entityManager; - private $security; + private EntityManagerInterface $entityManager; + private Security $security; public function __construct(EntityManagerInterface $entityManager, Security $security) { diff --git a/src/Services/PasswordResetManager.php b/src/Services/PasswordResetManager.php index 9d8a0c2c..545013db 100644 --- a/src/Services/PasswordResetManager.php +++ b/src/Services/PasswordResetManager.php @@ -51,15 +51,16 @@ use Symfony\Component\Mime\Address; use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; +use Symfony\Component\PasswordHasher\PasswordHasherInterface; use Symfony\Contracts\Translation\TranslatorInterface; class PasswordResetManager { - protected $mailer; - protected $em; - protected $passwordEncoder; - protected $translator; - protected $userPasswordEncoder; + protected MailerInterface $mailer; + protected EntityManagerInterface $em; + protected PasswordHasherInterface $passwordEncoder; + protected TranslatorInterface $translator; + protected UserPasswordHasherInterface $userPasswordEncoder; public function __construct(MailerInterface $mailer, EntityManagerInterface $em, TranslatorInterface $translator, UserPasswordHasherInterface $userPasswordEncoder, diff --git a/src/Services/PermissionResolver.php b/src/Services/PermissionResolver.php index d31c392d..d6eedfb7 100644 --- a/src/Services/PermissionResolver.php +++ b/src/Services/PermissionResolver.php @@ -56,8 +56,8 @@ class PermissionResolver { protected $permission_structure; - protected $is_debug; - protected $cache_file; + protected bool $is_debug; + protected string $cache_file; /** * PermissionResolver constructor. diff --git a/src/Services/PricedetailHelper.php b/src/Services/PricedetailHelper.php index 6d76276a..ea472aba 100644 --- a/src/Services/PricedetailHelper.php +++ b/src/Services/PricedetailHelper.php @@ -54,8 +54,8 @@ use function count; class PricedetailHelper { - protected $base_currency; - protected $locale; + protected string $base_currency; + protected string $locale; public function __construct(string $base_currency) { diff --git a/src/Services/StatisticsHelper.php b/src/Services/StatisticsHelper.php index 2e734b6e..d95836a4 100644 --- a/src/Services/StatisticsHelper.php +++ b/src/Services/StatisticsHelper.php @@ -34,6 +34,8 @@ use App\Entity\Parts\Part; use App\Entity\Parts\Storelocation; use App\Entity\Parts\Supplier; use App\Entity\PriceInformations\Currency; +use App\Repository\AttachmentRepository; +use App\Repository\PartRepository; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\NonUniqueResultException; @@ -42,9 +44,9 @@ use InvalidArgumentException; class StatisticsHelper { - protected $em; - protected $part_repo; - protected $attachment_repo; + protected EntityManagerInterface $em; + protected PartRepository $part_repo; + protected AttachmentRepository $attachment_repo; public function __construct(EntityManagerInterface $em) { diff --git a/src/Services/StructuralElementRecursionHelper.php b/src/Services/StructuralElementRecursionHelper.php index 1b04717c..45a9e9b1 100644 --- a/src/Services/StructuralElementRecursionHelper.php +++ b/src/Services/StructuralElementRecursionHelper.php @@ -47,7 +47,7 @@ use Doctrine\ORM\EntityManagerInterface; class StructuralElementRecursionHelper { - protected $em; + protected EntityManagerInterface $em; public function __construct(EntityManagerInterface $em) { diff --git a/src/Services/TFA/BackupCodeGenerator.php b/src/Services/TFA/BackupCodeGenerator.php index 419bf2aa..2c0b3479 100644 --- a/src/Services/TFA/BackupCodeGenerator.php +++ b/src/Services/TFA/BackupCodeGenerator.php @@ -50,8 +50,8 @@ use RuntimeException; */ class BackupCodeGenerator { - protected $code_length; - protected $code_count; + protected int $code_length; + protected int $code_count; /** * BackupCodeGenerator constructor. diff --git a/src/Services/TFA/BackupCodeManager.php b/src/Services/TFA/BackupCodeManager.php index 871381dd..4447c211 100644 --- a/src/Services/TFA/BackupCodeManager.php +++ b/src/Services/TFA/BackupCodeManager.php @@ -49,7 +49,7 @@ use App\Entity\UserSystem\User; */ class BackupCodeManager { - protected $backupCodeGenerator; + protected BackupCodeGenerator $backupCodeGenerator; public function __construct(BackupCodeGenerator $backupCodeGenerator) { diff --git a/src/Services/TagFinder.php b/src/Services/TagFinder.php index 4038bc34..9ffc3d02 100644 --- a/src/Services/TagFinder.php +++ b/src/Services/TagFinder.php @@ -53,7 +53,7 @@ use function array_slice; */ class TagFinder { - protected $em; + protected EntityManagerInterface $em; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Services/TranslationExtractor/PermissionExtractor.php b/src/Services/TranslationExtractor/PermissionExtractor.php index f5605fdf..b7cb4c8d 100644 --- a/src/Services/TranslationExtractor/PermissionExtractor.php +++ b/src/Services/TranslationExtractor/PermissionExtractor.php @@ -52,8 +52,8 @@ use Symfony\Component\Translation\MessageCatalogue; */ final class PermissionExtractor implements ExtractorInterface { - private $permission_structure; - private $finished = false; + private array $permission_structure; + private bool $finished = false; public function __construct(PermissionResolver $resolver) { diff --git a/src/Services/Trees/NodesListBuilder.php b/src/Services/Trees/NodesListBuilder.php index 0af0341c..ed6c0524 100644 --- a/src/Services/Trees/NodesListBuilder.php +++ b/src/Services/Trees/NodesListBuilder.php @@ -54,9 +54,9 @@ use Symfony\Contracts\Cache\TagAwareCacheInterface; */ class NodesListBuilder { - protected $em; - protected $cache; - protected $keyGenerator; + protected EntityManagerInterface $em; + protected TagAwareCacheInterface $cache; + protected UserCacheKeyGenerator $keyGenerator; public function __construct(EntityManagerInterface $em, TagAwareCacheInterface $treeCache, UserCacheKeyGenerator $keyGenerator) { diff --git a/src/Services/Trees/ToolsTreeBuilder.php b/src/Services/Trees/ToolsTreeBuilder.php index 95ab8766..654e8d4e 100644 --- a/src/Services/Trees/ToolsTreeBuilder.php +++ b/src/Services/Trees/ToolsTreeBuilder.php @@ -70,11 +70,11 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class ToolsTreeBuilder { - protected $translator; - protected $urlGenerator; - protected $keyGenerator; - protected $cache; - protected $security; + protected TranslatorInterface $translator; + protected UrlGeneratorInterface $urlGenerator; + protected UserCacheKeyGenerator $keyGenerator; + protected TagAwareCacheInterface $cache; + protected Security $security; public function __construct(TranslatorInterface $translator, UrlGeneratorInterface $urlGenerator, TagAwareCacheInterface $treeCache, UserCacheKeyGenerator $keyGenerator, diff --git a/src/Services/UserCacheKeyGenerator.php b/src/Services/UserCacheKeyGenerator.php index 5dac802b..e301da61 100644 --- a/src/Services/UserCacheKeyGenerator.php +++ b/src/Services/UserCacheKeyGenerator.php @@ -51,7 +51,7 @@ use Symfony\Component\Security\Core\Security; */ class UserCacheKeyGenerator { - protected $security; + protected Security $security; public function __construct(Security $security) { diff --git a/src/Twig/AttachmentExtension.php b/src/Twig/AttachmentExtension.php index ed120e85..c1da92c0 100644 --- a/src/Twig/AttachmentExtension.php +++ b/src/Twig/AttachmentExtension.php @@ -9,8 +9,8 @@ use Twig\TwigFunction; final class AttachmentExtension extends AbstractExtension { - protected $attachmentURLGenerator; - protected $FAIconGenerator; + protected AttachmentURLGenerator $attachmentURLGenerator; + protected FAIconGenerator $FAIconGenerator; public function __construct(AttachmentURLGenerator $attachmentURLGenerator, FAIconGenerator $FAIconGenerator) { @@ -18,7 +18,7 @@ final class AttachmentExtension extends AbstractExtension $this->FAIconGenerator = $FAIconGenerator; } - public function getFunctions() + public function getFunctions(): array { return [ /* Returns the URL to a thumbnail of the given attachment */ diff --git a/src/Twig/BarcodeExtension.php b/src/Twig/BarcodeExtension.php index fd31897d..4096450e 100644 --- a/src/Twig/BarcodeExtension.php +++ b/src/Twig/BarcodeExtension.php @@ -27,7 +27,7 @@ use Twig\TwigFunction; final class BarcodeExtension extends AbstractExtension { - public function getFunctions() + public function getFunctions(): array { return [ /* Generates a barcode with the given Type and Data and returns it as an SVG represenation */ diff --git a/src/Twig/EntityExtension.php b/src/Twig/EntityExtension.php index a51d5783..ccf6cf9f 100644 --- a/src/Twig/EntityExtension.php +++ b/src/Twig/EntityExtension.php @@ -25,9 +25,9 @@ use Twig\TwigTest; final class EntityExtension extends AbstractExtension { - protected $entityURLGenerator; - protected $treeBuilder; - private $nameGenerator; + protected EntityURLGenerator $entityURLGenerator; + protected TreeViewGenerator $treeBuilder; + private ElementTypeNameGenerator $nameGenerator; public function __construct(EntityURLGenerator $entityURLGenerator, TreeViewGenerator $treeBuilder, ElementTypeNameGenerator $elementTypeNameGenerator) { diff --git a/src/Twig/FormatExtension.php b/src/Twig/FormatExtension.php index 21a34106..82bd29a0 100644 --- a/src/Twig/FormatExtension.php +++ b/src/Twig/FormatExtension.php @@ -77,10 +77,10 @@ use function get_class; final class FormatExtension extends AbstractExtension { - protected $markdownParser; - protected $moneyFormatter; - protected $siformatter; - protected $amountFormatter; + protected MarkdownParser $markdownParser; + protected MoneyFormatter $moneyFormatter; + protected SIFormatter $siformatter; + protected AmountFormatter $amountFormatter; public function __construct(MarkdownParser $markdownParser, MoneyFormatter $moneyFormatter, diff --git a/src/Twig/Sandbox/InheritanceSecurityPolicy.php b/src/Twig/Sandbox/InheritanceSecurityPolicy.php index f11acc86..052366c0 100644 --- a/src/Twig/Sandbox/InheritanceSecurityPolicy.php +++ b/src/Twig/Sandbox/InheritanceSecurityPolicy.php @@ -35,11 +35,11 @@ use function is_array; */ final class InheritanceSecurityPolicy implements SecurityPolicyInterface { - private $allowedTags; - private $allowedFilters; - private $allowedMethods; - private $allowedProperties; - private $allowedFunctions; + private array $allowedTags; + private array $allowedFilters; + private array $allowedMethods; + private array $allowedProperties; + private array $allowedFunctions; public function __construct(array $allowedTags = [], array $allowedFilters = [], array $allowedMethods = [], array $allowedProperties = [], array $allowedFunctions = []) { diff --git a/src/Twig/TwigCoreExtension.php b/src/Twig/TwigCoreExtension.php index 60495b7a..c34d7d5a 100644 --- a/src/Twig/TwigCoreExtension.php +++ b/src/Twig/TwigCoreExtension.php @@ -13,7 +13,7 @@ use Twig\TwigTest; */ final class TwigCoreExtension extends AbstractExtension { - protected $objectNormalizer; + protected ObjectNormalizer $objectNormalizer; public function __construct(ObjectNormalizer $objectNormalizer) { diff --git a/src/Twig/UserExtension.php b/src/Twig/UserExtension.php index 723f2ced..12fae233 100644 --- a/src/Twig/UserExtension.php +++ b/src/Twig/UserExtension.php @@ -32,8 +32,7 @@ use Twig\TwigFunction; final class UserExtension extends AbstractExtension { - /** @var LogEntryRepository */ - private $repo; + private LogEntryRepository $repo; public function __construct(EntityManagerInterface $em) { diff --git a/src/Validator/Constraints/Misc/ValidRangeValidator.php b/src/Validator/Constraints/Misc/ValidRangeValidator.php index 71c42e19..da750c9d 100644 --- a/src/Validator/Constraints/Misc/ValidRangeValidator.php +++ b/src/Validator/Constraints/Misc/ValidRangeValidator.php @@ -31,7 +31,7 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException; class ValidRangeValidator extends ConstraintValidator { - protected $rangeParser; + protected RangeParser $rangeParser; public function __construct(RangeParser $rangeParser) { diff --git a/src/Validator/Constraints/NoLockoutValidator.php b/src/Validator/Constraints/NoLockoutValidator.php index d333295c..cfe5ffb9 100644 --- a/src/Validator/Constraints/NoLockoutValidator.php +++ b/src/Validator/Constraints/NoLockoutValidator.php @@ -53,10 +53,10 @@ use Symfony\Component\Validator\ConstraintValidator; class NoLockoutValidator extends ConstraintValidator { - protected $resolver; - protected $perm_structure; - protected $security; - protected $entityManager; + protected PermissionResolver $resolver; + protected array $perm_structure; + protected Security $security; + protected EntityManagerInterface $entityManager; public function __construct(PermissionResolver $resolver, Security $security, EntityManagerInterface $entityManager) { diff --git a/src/Validator/Constraints/ValidFileFilterValidator.php b/src/Validator/Constraints/ValidFileFilterValidator.php index 2aa31411..5a7b61c2 100644 --- a/src/Validator/Constraints/ValidFileFilterValidator.php +++ b/src/Validator/Constraints/ValidFileFilterValidator.php @@ -52,7 +52,7 @@ use function is_string; class ValidFileFilterValidator extends ConstraintValidator { - protected $filterTools; + protected FileTypeFilterTools $filterTools; public function __construct(FileTypeFilterTools $filterTools) { diff --git a/src/Validator/Constraints/ValidGoogleAuthCodeValidator.php b/src/Validator/Constraints/ValidGoogleAuthCodeValidator.php index 7404cb00..0a3198ab 100644 --- a/src/Validator/Constraints/ValidGoogleAuthCodeValidator.php +++ b/src/Validator/Constraints/ValidGoogleAuthCodeValidator.php @@ -56,7 +56,7 @@ use function strlen; class ValidGoogleAuthCodeValidator extends ConstraintValidator { - protected $googleAuthenticator; + protected GoogleAuthenticatorInterface $googleAuthenticator; public function __construct(GoogleAuthenticatorInterface $googleAuthenticator) { diff --git a/src/Validator/Constraints/ValidPartLotValidator.php b/src/Validator/Constraints/ValidPartLotValidator.php index 1028bccc..ca3ee1e7 100644 --- a/src/Validator/Constraints/ValidPartLotValidator.php +++ b/src/Validator/Constraints/ValidPartLotValidator.php @@ -52,7 +52,7 @@ use Symfony\Component\Validator\ConstraintValidator; class ValidPartLotValidator extends ConstraintValidator { - protected $em; + protected EntityManagerInterface $em; public function __construct(EntityManagerInterface $em) { diff --git a/src/Validator/Constraints/ValidPermissionValidator.php b/src/Validator/Constraints/ValidPermissionValidator.php index 77c58672..54b84b21 100644 --- a/src/Validator/Constraints/ValidPermissionValidator.php +++ b/src/Validator/Constraints/ValidPermissionValidator.php @@ -50,8 +50,8 @@ use Symfony\Component\Validator\ConstraintValidator; class ValidPermissionValidator extends ConstraintValidator { - protected $resolver; - protected $perm_structure; + protected PermissionResolver $resolver; + protected array $perm_structure; public function __construct(PermissionResolver $resolver) { diff --git a/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php b/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php index 626d4145..049c6441 100644 --- a/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php +++ b/tests/Services/LabelSystem/PlaceholderProviders/AbstractElementProviderTest.php @@ -41,7 +41,7 @@ class AbstractElementProviderTest extends WebTestCase self::bootKernel(); $this->service = self::$container->get(AbstractDBElementProvider::class); $this->target = new class() extends AbstractDBElement { - protected $id = 123; + protected ?int $id = 123; }; }