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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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