Use typed properties

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

View file

@ -30,7 +30,7 @@ use InvalidArgumentException;
final class BarcodeGenerator
{
private $barcodeContentGenerator;
private BarcodeContentGenerator $barcodeContentGenerator;
public function __construct(BarcodeContentGenerator $barcodeContentGenerator)
{

View file

@ -43,7 +43,8 @@ final class BarcodeContentGenerator
PartLot::class => 'lot',
Storelocation::class => 'location',
];
private $urlGenerator;
private UrlGeneratorInterface $urlGenerator;
public function __construct(UrlGeneratorInterface $urlGenerator)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)

View file

@ -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)
{

View file

@ -31,7 +31,7 @@ use App\Services\LabelSystem\PlaceholderProviders\PlaceholderProviderInterface;
*/
final class LabelTextReplacer
{
private $providers;
private iterable $providers;
public function __construct(iterable $providers)
{

View file

@ -28,7 +28,7 @@ use App\Services\ElementTypeNameGenerator;
final class AbstractDBElementProvider implements PlaceholderProviderInterface
{
private $elementTypeNameGenerator;
private ElementTypeNameGenerator $elementTypeNameGenerator;
public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -96,7 +96,7 @@ final class SandboxedTwigProvider
];
private const ALLOWED_PROPERTIES = [];
private $appExtension;
private FormatExtension $appExtension;
public function __construct(FormatExtension $appExtension)
{