Migrate to readonly properties

This commit is contained in:
Yassine Guedidi
2025-04-05 13:59:36 +02:00
parent a107773c11
commit ca018c77e3
71 changed files with 203 additions and 199 deletions

View File

@ -17,7 +17,7 @@ class CryptoProxy
public function __construct(
$encryptionKeyPath,
private LoggerInterface $logger,
private readonly LoggerInterface $logger,
) {
if (!file_exists($encryptionKeyPath)) {
$key = Key::createNewRandomKey();

View File

@ -20,10 +20,10 @@ class DownloadImages
private $wallabagUrl;
public function __construct(
private HttpClientInterface $client,
private readonly HttpClientInterface $client,
private $baseFolder,
$wallabagUrl,
private LoggerInterface $logger,
private readonly LoggerInterface $logger,
) {
$this->wallabagUrl = rtrim($wallabagUrl, '/');
$this->mimeTypes = new MimeTypes();

View File

@ -31,10 +31,10 @@ class EntriesExport
* @param TokenStorageInterface $tokenStorage Needed to retrieve the current user
*/
public function __construct(
private TranslatorInterface $translator,
private readonly TranslatorInterface $translator,
private $wallabagUrl,
private $logoPath,
private TokenStorageInterface $tokenStorage,
private readonly TokenStorageInterface $tokenStorage,
) {
}

View File

@ -11,7 +11,7 @@ use Wallabag\Entity\User;
class PreparePagerForEntries
{
public function __construct(
private TokenStorageInterface $tokenStorage,
private readonly TokenStorageInterface $tokenStorage,
) {
}

View File

@ -14,8 +14,8 @@ use Wallabag\Entity\User;
class Redirect
{
public function __construct(
private UrlGeneratorInterface $router,
private TokenStorageInterface $tokenStorage,
private readonly UrlGeneratorInterface $router,
private readonly TokenStorageInterface $tokenStorage,
) {
}

View File

@ -15,10 +15,10 @@ use Wallabag\Repository\TagRepository;
class RuleBasedTagger
{
public function __construct(
private RulerZ $rulerz,
private TagRepository $tagRepository,
private EntryRepository $entryRepository,
private LoggerInterface $logger,
private readonly RulerZ $rulerz,
private readonly TagRepository $tagRepository,
private readonly EntryRepository $entryRepository,
private readonly LoggerInterface $logger,
) {
}