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

@ -55,7 +55,7 @@ use function strlen;
*/
class AttachmentManager
{
protected $pathResolver;
protected AttachmentPathResolver $pathResolver;
public function __construct(AttachmentPathResolver $pathResolver)
{

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -47,7 +47,7 @@ use App\Entity\Parts\Part;
class PartPreviewGenerator
{
protected $attachmentHelper;
protected AttachmentManager $attachmentHelper;
public function __construct(AttachmentManager $attachmentHelper)
{