forked from wallabag/wallabag
Migrate to constructor promoted properties
This commit is contained in:
@ -17,26 +17,19 @@ use Wallabag\Tools\Utils;
|
||||
*/
|
||||
class ContentProxy
|
||||
{
|
||||
protected $graby;
|
||||
protected $tagger;
|
||||
protected $ignoreOriginProcessor;
|
||||
protected $validator;
|
||||
protected $logger;
|
||||
protected $mimeTypes;
|
||||
protected $fetchingErrorMessage;
|
||||
protected $eventDispatcher;
|
||||
protected $storeArticleHeaders;
|
||||
|
||||
public function __construct(Graby $graby, RuleBasedTagger $tagger, RuleBasedIgnoreOriginProcessor $ignoreOriginProcessor, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders = false)
|
||||
{
|
||||
$this->graby = $graby;
|
||||
$this->tagger = $tagger;
|
||||
$this->ignoreOriginProcessor = $ignoreOriginProcessor;
|
||||
$this->validator = $validator;
|
||||
$this->logger = $logger;
|
||||
public function __construct(
|
||||
protected Graby $graby,
|
||||
protected RuleBasedTagger $tagger,
|
||||
protected RuleBasedIgnoreOriginProcessor $ignoreOriginProcessor,
|
||||
protected ValidatorInterface $validator,
|
||||
protected LoggerInterface $logger,
|
||||
protected $fetchingErrorMessage,
|
||||
protected $storeArticleHeaders = false,
|
||||
) {
|
||||
$this->mimeTypes = new MimeTypes();
|
||||
$this->fetchingErrorMessage = $fetchingErrorMessage;
|
||||
$this->storeArticleHeaders = $storeArticleHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,7 +100,9 @@ class ContentProxy
|
||||
return;
|
||||
}
|
||||
|
||||
$this->logger->warning('Language validation failed. ' . (string) $errors);
|
||||
foreach ($errors as $error) {
|
||||
$this->logger->warning('Language validation failed. ' . $error->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,7 +123,9 @@ class ContentProxy
|
||||
return;
|
||||
}
|
||||
|
||||
$this->logger->warning('PreviewPicture validation failed. ' . (string) $errors);
|
||||
foreach ($errors as $error) {
|
||||
$this->logger->warning('PreviewPicture validation failed. ' . $error->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -13,13 +13,12 @@ use Psr\Log\LoggerInterface;
|
||||
*/
|
||||
class CryptoProxy
|
||||
{
|
||||
private $logger;
|
||||
private $encryptionKey;
|
||||
|
||||
public function __construct($encryptionKeyPath, LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
|
||||
public function __construct(
|
||||
$encryptionKeyPath,
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
if (!file_exists($encryptionKeyPath)) {
|
||||
$key = Key::createNewRandomKey();
|
||||
|
||||
|
||||
@ -16,19 +16,16 @@ use Symfony\Contracts\HttpClient\ResponseInterface;
|
||||
class DownloadImages
|
||||
{
|
||||
public const REGENERATE_PICTURES_QUALITY = 80;
|
||||
|
||||
private $client;
|
||||
private $baseFolder;
|
||||
private $logger;
|
||||
private $mimeTypes;
|
||||
private $wallabagUrl;
|
||||
|
||||
public function __construct(HttpClientInterface $downloadImagesClient, $baseFolder, $wallabagUrl, LoggerInterface $logger)
|
||||
{
|
||||
$this->client = $downloadImagesClient;
|
||||
$this->baseFolder = $baseFolder;
|
||||
public function __construct(
|
||||
private HttpClientInterface $client,
|
||||
private $baseFolder,
|
||||
$wallabagUrl,
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
$this->wallabagUrl = rtrim($wallabagUrl, '/');
|
||||
$this->logger = $logger;
|
||||
$this->mimeTypes = new MimeTypes();
|
||||
|
||||
$this->setFolder();
|
||||
|
||||
@ -19,10 +19,6 @@ use Wallabag\Entity\User;
|
||||
*/
|
||||
class EntriesExport
|
||||
{
|
||||
private $wallabagUrl;
|
||||
private $logoPath;
|
||||
private $translator;
|
||||
private $tokenStorage;
|
||||
private $title = '';
|
||||
private $entries = [];
|
||||
private $author = 'wallabag';
|
||||
@ -34,12 +30,12 @@ class EntriesExport
|
||||
* @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE
|
||||
* @param TokenStorageInterface $tokenStorage Needed to retrieve the current user
|
||||
*/
|
||||
public function __construct(TranslatorInterface $translator, $wallabagUrl, $logoPath, TokenStorageInterface $tokenStorage)
|
||||
{
|
||||
$this->translator = $translator;
|
||||
$this->wallabagUrl = $wallabagUrl;
|
||||
$this->logoPath = $logoPath;
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
public function __construct(
|
||||
private TranslatorInterface $translator,
|
||||
private $wallabagUrl,
|
||||
private $logoPath,
|
||||
private TokenStorageInterface $tokenStorage,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -10,11 +10,9 @@ use Wallabag\Entity\User;
|
||||
|
||||
class PreparePagerForEntries
|
||||
{
|
||||
private $tokenStorage;
|
||||
|
||||
public function __construct(TokenStorageInterface $tokenStorage)
|
||||
{
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
public function __construct(
|
||||
private TokenStorageInterface $tokenStorage,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -13,13 +13,10 @@ use Wallabag\Entity\User;
|
||||
*/
|
||||
class Redirect
|
||||
{
|
||||
private $router;
|
||||
private $tokenStorage;
|
||||
|
||||
public function __construct(UrlGeneratorInterface $router, TokenStorageInterface $tokenStorage)
|
||||
{
|
||||
$this->router = $router;
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
public function __construct(
|
||||
private UrlGeneratorInterface $router,
|
||||
private TokenStorageInterface $tokenStorage,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -9,15 +9,11 @@ use Wallabag\Repository\IgnoreOriginInstanceRuleRepository;
|
||||
|
||||
class RuleBasedIgnoreOriginProcessor
|
||||
{
|
||||
protected $rulerz;
|
||||
protected $logger;
|
||||
protected $ignoreOriginInstanceRuleRepository;
|
||||
|
||||
public function __construct(RulerZ $rulerz, LoggerInterface $logger, IgnoreOriginInstanceRuleRepository $ignoreOriginInstanceRuleRepository)
|
||||
{
|
||||
$this->rulerz = $rulerz;
|
||||
$this->logger = $logger;
|
||||
$this->ignoreOriginInstanceRuleRepository = $ignoreOriginInstanceRuleRepository;
|
||||
public function __construct(
|
||||
protected RulerZ $rulerz,
|
||||
protected LoggerInterface $logger,
|
||||
protected IgnoreOriginInstanceRuleRepository $ignoreOriginInstanceRuleRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -14,17 +14,12 @@ use Wallabag\Repository\TagRepository;
|
||||
|
||||
class RuleBasedTagger
|
||||
{
|
||||
private $rulerz;
|
||||
private $tagRepository;
|
||||
private $entryRepository;
|
||||
private $logger;
|
||||
|
||||
public function __construct(RulerZ $rulerz, TagRepository $tagRepository, EntryRepository $entryRepository, LoggerInterface $logger)
|
||||
{
|
||||
$this->rulerz = $rulerz;
|
||||
$this->tagRepository = $tagRepository;
|
||||
$this->entryRepository = $entryRepository;
|
||||
$this->logger = $logger;
|
||||
public function __construct(
|
||||
private RulerZ $rulerz,
|
||||
private TagRepository $tagRepository,
|
||||
private EntryRepository $entryRepository,
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -8,14 +8,9 @@ use Wallabag\Repository\TagRepository;
|
||||
|
||||
class TagsAssigner
|
||||
{
|
||||
/**
|
||||
* @var TagRepository
|
||||
*/
|
||||
protected $tagRepository;
|
||||
|
||||
public function __construct(TagRepository $tagRepository)
|
||||
{
|
||||
$this->tagRepository = $tagRepository;
|
||||
public function __construct(
|
||||
protected TagRepository $tagRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user