1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-06-27 16:36:00 +00:00

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

@ -9,7 +9,7 @@ use Wallabag\Entity\IgnoreOriginInstanceRule;
class IgnoreOriginInstanceRuleFixtures extends Fixture
{
public function __construct(
private array $defaultIgnoreOriginInstanceRules,
private readonly array $defaultIgnoreOriginInstanceRules,
) {
}

View file

@ -9,7 +9,7 @@ use Wallabag\Entity\InternalSetting;
class InternalSettingFixtures extends Fixture
{
public function __construct(
private array $defaultInternalSettings,
private readonly array $defaultInternalSettings,
) {
}

View file

@ -12,7 +12,7 @@ use Wallabag\Helper\CryptoProxy;
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface
{
public function __construct(
private CryptoProxy $cryptoProxy,
private readonly CryptoProxy $cryptoProxy,
) {
}

View file

@ -4,6 +4,7 @@ declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
return RectorConfig::configure()
->withPaths([
@ -18,6 +19,9 @@ return RectorConfig::configure()
->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [
'inline_public' => true,
])
->withRules([
ReadOnlyPropertyRector::class,
])
->withSkip([
ClassPropertyAssignToConstructorPromotionRector::class => [
__DIR__ . '/src/Entity/*',

View file

@ -17,8 +17,8 @@ class CleanDownloadedImagesCommand extends Command
protected static $defaultDescription = 'Cleans downloaded images which are no more associated to an entry';
public function __construct(
private EntryRepository $entryRepository,
private DownloadImages $downloadImages,
private readonly EntryRepository $entryRepository,
private readonly DownloadImages $downloadImages,
) {
parent::__construct();
}

View file

@ -23,9 +23,9 @@ class CleanDuplicatesCommand extends Command
protected int $duplicates = 0;
public function __construct(
private EntityManagerInterface $entityManager,
private EntryRepository $entryRepository,
private UserRepository $userRepository,
private readonly EntityManagerInterface $entityManager,
private readonly EntryRepository $entryRepository,
private readonly UserRepository $userRepository,
) {
parent::__construct();
}

View file

@ -18,10 +18,10 @@ class ExportCommand extends Command
protected static $defaultDescription = 'Export all entries for an user';
public function __construct(
private EntryRepository $entryRepository,
private UserRepository $userRepository,
private EntriesExport $entriesExport,
private string $projectDir,
private readonly EntryRepository $entryRepository,
private readonly UserRepository $userRepository,
private readonly EntriesExport $entriesExport,
private readonly string $projectDir,
) {
parent::__construct();
}

View file

@ -21,9 +21,9 @@ class GenerateUrlHashesCommand extends Command
protected OutputInterface $output;
public function __construct(
private EntityManagerInterface $entityManager,
private EntryRepository $entryRepository,
private UserRepository $userRepository,
private readonly EntityManagerInterface $entityManager,
private readonly EntryRepository $entryRepository,
private readonly UserRepository $userRepository,
) {
parent::__construct();
}

View file

@ -34,21 +34,21 @@ class ImportCommand extends Command
protected static $defaultDescription = 'Import entries from a JSON export';
public function __construct(
private EntityManagerInterface $entityManager,
private TokenStorageInterface $tokenStorage,
private UserRepository $userRepository,
private WallabagV2Import $wallabagV2Import,
private FirefoxImport $firefoxImport,
private ChromeImport $chromeImport,
private ReadabilityImport $readabilityImport,
private InstapaperImport $instapaperImport,
private PinboardImport $pinboardImport,
private DeliciousImport $deliciousImport,
private WallabagV1Import $wallabagV1Import,
private ElcuratorImport $elcuratorImport,
private ShaarliImport $shaarliImport,
private PocketHtmlImport $pocketHtmlImport,
private OmnivoreImport $omnivoreImport,
private readonly EntityManagerInterface $entityManager,
private readonly TokenStorageInterface $tokenStorage,
private readonly UserRepository $userRepository,
private readonly WallabagV2Import $wallabagV2Import,
private readonly FirefoxImport $firefoxImport,
private readonly ChromeImport $chromeImport,
private readonly ReadabilityImport $readabilityImport,
private readonly InstapaperImport $instapaperImport,
private readonly PinboardImport $pinboardImport,
private readonly DeliciousImport $deliciousImport,
private readonly WallabagV1Import $wallabagV1Import,
private readonly ElcuratorImport $elcuratorImport,
private readonly ShaarliImport $shaarliImport,
private readonly PocketHtmlImport $pocketHtmlImport,
private readonly OmnivoreImport $omnivoreImport,
) {
parent::__construct();
}

View file

@ -17,7 +17,7 @@ class RedisWorkerCommand extends Command
protected static $defaultDescription = 'Launch Redis worker';
public function __construct(
private ContainerInterface $container,
private readonly ContainerInterface $container,
) {
parent::__construct();
}

View file

@ -38,13 +38,13 @@ class InstallCommand extends Command
];
public function __construct(
private EntityManagerInterface $entityManager,
private EventDispatcherInterface $dispatcher,
private UserManagerInterface $userManager,
private TableMetadataStorageConfiguration $tableMetadataStorageConfiguration,
private string $databaseDriver,
private array $defaultSettings,
private array $defaultIgnoreOriginInstanceRules,
private readonly EntityManagerInterface $entityManager,
private readonly EventDispatcherInterface $dispatcher,
private readonly UserManagerInterface $userManager,
private readonly TableMetadataStorageConfiguration $tableMetadataStorageConfiguration,
private readonly string $databaseDriver,
private readonly array $defaultSettings,
private readonly array $defaultIgnoreOriginInstanceRules,
) {
parent::__construct();
}

View file

@ -16,7 +16,7 @@ class ListUserCommand extends Command
protected static $defaultDescription = 'List all users';
public function __construct(
private UserRepository $userRepository,
private readonly UserRepository $userRepository,
) {
parent::__construct();
}

View file

@ -22,11 +22,11 @@ class ReloadEntryCommand extends Command
protected static $defaultDescription = 'Reload entries';
public function __construct(
private EntryRepository $entryRepository,
private UserRepository $userRepository,
private EntityManagerInterface $entityManager,
private ContentProxy $contentProxy,
private EventDispatcherInterface $dispatcher,
private readonly EntryRepository $entryRepository,
private readonly UserRepository $userRepository,
private readonly EntityManagerInterface $entityManager,
private readonly ContentProxy $contentProxy,
private readonly EventDispatcherInterface $dispatcher,
) {
parent::__construct();
}

View file

@ -19,7 +19,7 @@ class ShowUserCommand extends Command
protected SymfonyStyle $io;
public function __construct(
private UserRepository $userRepository,
private readonly UserRepository $userRepository,
) {
parent::__construct();
}

View file

@ -19,9 +19,9 @@ class TagAllCommand extends Command
protected static $defaultDescription = 'Tag all entries using the tagging rules.';
public function __construct(
private EntityManagerInterface $entityManager,
private RuleBasedTagger $ruleBasedTagger,
private UserRepository $userRepository,
private readonly EntityManagerInterface $entityManager,
private readonly RuleBasedTagger $ruleBasedTagger,
private readonly UserRepository $userRepository,
) {
parent::__construct();
}

View file

@ -16,9 +16,9 @@ class UpdatePicturesPathCommand extends Command
protected static $defaultDescription = 'Update the path of the pictures for each entry when you changed your wallabag instance URL.';
public function __construct(
private EntityManagerInterface $entityManager,
private EntryRepository $entryRepository,
private string $wallabagUrl,
private readonly EntityManagerInterface $entityManager,
private readonly EntryRepository $entryRepository,
private readonly string $wallabagUrl,
) {
parent::__construct();
}

View file

@ -11,19 +11,19 @@ use OldSound\RabbitMqBundle\RabbitMq\Consumer;
class RabbitMQConsumerTotalProxy
{
public function __construct(
private Consumer $pocketConsumer,
private Consumer $readabilityConsumer,
private Consumer $wallabagV1Consumer,
private Consumer $wallabagV2Consumer,
private Consumer $firefoxConsumer,
private Consumer $chromeConsumer,
private Consumer $instapaperConsumer,
private Consumer $pinboardConsumer,
private Consumer $deliciousConsumer,
private Consumer $elcuratorConsumer,
private Consumer $shaarliConsumer,
private Consumer $pocketHtmlConsumer,
private Consumer $omnivoreConsumer,
private readonly Consumer $pocketConsumer,
private readonly Consumer $readabilityConsumer,
private readonly Consumer $wallabagV1Consumer,
private readonly Consumer $wallabagV2Consumer,
private readonly Consumer $firefoxConsumer,
private readonly Consumer $chromeConsumer,
private readonly Consumer $instapaperConsumer,
private readonly Consumer $pinboardConsumer,
private readonly Consumer $deliciousConsumer,
private readonly Consumer $elcuratorConsumer,
private readonly Consumer $shaarliConsumer,
private readonly Consumer $pocketHtmlConsumer,
private readonly Consumer $omnivoreConsumer,
) {
}

View file

@ -45,14 +45,14 @@ use Wallabag\Tools\Utils;
class ConfigController extends AbstractController
{
public function __construct(
private EntityManagerInterface $entityManager,
private UserManagerInterface $userManager,
private EntryRepository $entryRepository,
private TagRepository $tagRepository,
private AnnotationRepository $annotationRepository,
private ConfigRepository $configRepository,
private EventDispatcherInterface $eventDispatcher,
private Redirect $redirectHelper,
private readonly EntityManagerInterface $entityManager,
private readonly UserManagerInterface $userManager,
private readonly EntryRepository $entryRepository,
private readonly TagRepository $tagRepository,
private readonly AnnotationRepository $annotationRepository,
private readonly ConfigRepository $configRepository,
private readonly EventDispatcherInterface $eventDispatcher,
private readonly Redirect $redirectHelper,
) {
}

View file

@ -34,14 +34,14 @@ use Wallabag\Repository\TagRepository;
class EntryController extends AbstractController
{
public function __construct(
private EntityManagerInterface $entityManager,
private EventDispatcherInterface $eventDispatcher,
private EntryRepository $entryRepository,
private Redirect $redirectHelper,
private PreparePagerForEntries $preparePagerForEntriesHelper,
private FilterBuilderUpdaterInterface $filterBuilderUpdater,
private ContentProxy $contentProxy,
private Security $security,
private readonly EntityManagerInterface $entityManager,
private readonly EventDispatcherInterface $eventDispatcher,
private readonly EntryRepository $entryRepository,
private readonly Redirect $redirectHelper,
private readonly PreparePagerForEntries $preparePagerForEntriesHelper,
private readonly FilterBuilderUpdaterInterface $filterBuilderUpdater,
private readonly ContentProxy $contentProxy,
private readonly Security $security,
) {
}

View file

@ -21,7 +21,7 @@ use Wallabag\Repository\EntryRepository;
class FeedController extends AbstractController
{
public function __construct(
private EntryRepository $entryRepository,
private readonly EntryRepository $entryRepository,
) {
}

View file

@ -21,8 +21,8 @@ use Wallabag\Repository\IgnoreOriginInstanceRuleRepository;
class IgnoreOriginInstanceRuleController extends AbstractController
{
public function __construct(
private EntityManagerInterface $entityManager,
private TranslatorInterface $translator,
private readonly EntityManagerInterface $entityManager,
private readonly TranslatorInterface $translator,
) {
}

View file

@ -14,10 +14,10 @@ use Wallabag\Redis\Producer as RedisProducer;
class ChromeController extends BrowserController
{
public function __construct(
private ChromeImport $chromeImport,
private Config $craueConfig,
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly ChromeImport $chromeImport,
private readonly Config $craueConfig,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -16,8 +16,8 @@ use Wallabag\Redis\Producer as RedisProducer;
class DeliciousController extends AbstractController
{
public function __construct(
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -14,10 +14,10 @@ use Wallabag\Redis\Producer as RedisProducer;
class ElcuratorController extends WallabagController
{
public function __construct(
private ElcuratorImport $elcuratorImport,
private Config $craueConfig,
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly ElcuratorImport $elcuratorImport,
private readonly Config $craueConfig,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -14,10 +14,10 @@ use Wallabag\Redis\Producer as RedisProducer;
class FirefoxController extends BrowserController
{
public function __construct(
private FirefoxImport $firefoxImport,
private Config $craueConfig,
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly FirefoxImport $firefoxImport,
private readonly Config $craueConfig,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -14,8 +14,8 @@ use Wallabag\Import\ImportChain;
class ImportController extends AbstractController
{
public function __construct(
private RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy,
private Client $redisClient,
private readonly RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy,
private readonly Client $redisClient,
) {
}

View file

@ -16,8 +16,8 @@ use Wallabag\Redis\Producer as RedisProducer;
class InstapaperController extends AbstractController
{
public function __construct(
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -16,8 +16,8 @@ use Wallabag\Redis\Producer as RedisProducer;
class OmnivoreController extends AbstractController
{
public function __construct(
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -16,8 +16,8 @@ use Wallabag\Redis\Producer as RedisProducer;
class PinboardController extends AbstractController
{
public function __construct(
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -18,10 +18,10 @@ use Wallabag\Redis\Producer as RedisProducer;
class PocketController extends AbstractController
{
public function __construct(
private Config $craueConfig,
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private SessionInterface $session,
private readonly Config $craueConfig,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
private readonly SessionInterface $session,
) {
}

View file

@ -14,10 +14,10 @@ use Wallabag\Redis\Producer as RedisProducer;
class PocketHtmlController extends HtmlController
{
public function __construct(
private PocketHtmlImport $pocketHtmlImport,
private Config $craueConfig,
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly PocketHtmlImport $pocketHtmlImport,
private readonly Config $craueConfig,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -16,8 +16,8 @@ use Wallabag\Redis\Producer as RedisProducer;
class ReadabilityController extends AbstractController
{
public function __construct(
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -14,10 +14,10 @@ use Wallabag\Redis\Producer as RedisProducer;
class ShaarliController extends HtmlController
{
public function __construct(
private ShaarliImport $shaarliImport,
private Config $craueConfig,
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly ShaarliImport $shaarliImport,
private readonly Config $craueConfig,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -14,10 +14,10 @@ use Wallabag\Redis\Producer as RedisProducer;
class WallabagV1Controller extends WallabagController
{
public function __construct(
private WallabagV1Import $wallabagImport,
private Config $craueConfig,
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly WallabagV1Import $wallabagImport,
private readonly Config $craueConfig,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -14,10 +14,10 @@ use Wallabag\Redis\Producer as RedisProducer;
class WallabagV2Controller extends WallabagController
{
public function __construct(
private WallabagV2Import $wallabagImport,
private Config $craueConfig,
private RabbitMqProducer $rabbitMqProducer,
private RedisProducer $redisProducer,
private readonly WallabagV2Import $wallabagImport,
private readonly Config $craueConfig,
private readonly RabbitMqProducer $rabbitMqProducer,
private readonly RedisProducer $redisProducer,
) {
}

View file

@ -24,10 +24,10 @@ use Wallabag\Repository\SiteCredentialRepository;
class SiteCredentialController extends AbstractController
{
public function __construct(
private EntityManagerInterface $entityManager,
private TranslatorInterface $translator,
private CryptoProxy $cryptoProxy,
private Config $craueConfig,
private readonly EntityManagerInterface $entityManager,
private readonly TranslatorInterface $translator,
private readonly CryptoProxy $cryptoProxy,
private readonly Config $craueConfig,
) {
}

View file

@ -26,10 +26,10 @@ use Wallabag\Repository\TagRepository;
class TagController extends AbstractController
{
public function __construct(
private EntityManagerInterface $entityManager,
private TagsAssigner $tagsAssigner,
private Redirect $redirectHelper,
private Security $security,
private readonly EntityManagerInterface $entityManager,
private readonly TagsAssigner $tagsAssigner,
private readonly Redirect $redirectHelper,
private readonly Security $security,
) {
}

View file

@ -30,8 +30,8 @@ use Wallabag\Repository\UserRepository;
class UserController extends AbstractController
{
public function __construct(
private EntityManagerInterface $entityManager,
private TranslatorInterface $translator,
private readonly EntityManagerInterface $entityManager,
private readonly TranslatorInterface $translator,
) {
}

View file

@ -11,10 +11,10 @@ use Doctrine\Migrations\Version\MigrationFactory;
class MigrationFactoryDecorator implements MigrationFactory
{
public function __construct(
private MigrationFactory $migrationFactory,
private string $tablePrefix,
private array $defaultIgnoreOriginInstanceRules,
private string $fetchingErrorMessage,
private readonly MigrationFactory $migrationFactory,
private readonly string $tablePrefix,
private readonly array $defaultIgnoreOriginInstanceRules,
private readonly string $fetchingErrorMessage,
) {
}

View file

@ -10,8 +10,8 @@ use Symfony\Component\Security\Http\Event\LoginFailureEvent;
class AuthenticationFailureListener implements EventSubscriberInterface
{
public function __construct(
private RequestStack $requestStack,
private LoggerInterface $logger,
private readonly RequestStack $requestStack,
private readonly LoggerInterface $logger,
) {
}

View file

@ -16,7 +16,7 @@ use Wallabag\Entity\Config;
class CreateConfigListener implements EventSubscriberInterface
{
public function __construct(
private EntityManagerInterface $em,
private readonly EntityManagerInterface $em,
private $itemsOnPage,
private $feedLimit,
private $language,
@ -24,7 +24,7 @@ class CreateConfigListener implements EventSubscriberInterface
private $actionMarkAsRead,
private $listMode,
private $displayThumbnails,
private RequestStack $requestStack,
private readonly RequestStack $requestStack,
) {
}

View file

@ -16,7 +16,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class PasswordResettingListener implements EventSubscriberInterface
{
public function __construct(
private UrlGeneratorInterface $router,
private readonly UrlGeneratorInterface $router,
) {
}

View file

@ -15,7 +15,7 @@ class RegistrationListener implements EventSubscriberInterface
*/
public function __construct(
private $registrationEnabled,
private UrlGeneratorInterface $urlGenerator,
private readonly UrlGeneratorInterface $urlGenerator,
) {
}

View file

@ -17,7 +17,7 @@ use Wallabag\Entity\User;
class UserLocaleListener
{
public function __construct(
private SessionInterface $session,
private readonly SessionInterface $session,
) {
}

View file

@ -13,10 +13,10 @@ use Wallabag\Helper\DownloadImages;
class DownloadImagesSubscriber implements EventSubscriberInterface
{
public function __construct(
private EntityManagerInterface $em,
private DownloadImages $downloadImages,
private readonly EntityManagerInterface $em,
private readonly DownloadImages $downloadImages,
private $enabled,
private LoggerInterface $logger,
private readonly LoggerInterface $logger,
) {
}

View file

@ -10,8 +10,8 @@ use Wallabag\Event\ConfigUpdatedEvent;
class GenerateCustomCSSSubscriber implements EventSubscriberInterface
{
public function __construct(
private EntityManagerInterface $em,
private Compiler $compiler,
private readonly EntityManagerInterface $em,
private readonly Compiler $compiler,
) {
}

View file

@ -18,7 +18,7 @@ use Wallabag\Entity\Entry;
class SQLiteCascadeDeleteSubscriber implements EventSubscriber
{
public function __construct(
private ManagerRegistry $doctrine,
private readonly ManagerRegistry $doctrine,
) {
}

View file

@ -9,7 +9,7 @@ use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs;
class SchemaAdapterSubscriber implements EventSubscriber
{
public function __construct(
private string $databaseTablePrefix,
private readonly string $databaseTablePrefix,
) {
}

View file

@ -10,7 +10,7 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
class AuthenticatorProvider implements ExpressionFunctionProviderInterface
{
public function __construct(
private HttpClientInterface $requestHtmlFunctionClient,
private readonly HttpClientInterface $requestHtmlFunctionClient,
) {
}

View file

@ -25,8 +25,8 @@ class EntryFilterType extends AbstractType
* Repository & user are used to get a list of language entries for this user.
*/
public function __construct(
private EntryRepository $repository,
private TokenStorageInterface $tokenStorage,
private readonly EntryRepository $repository,
private readonly TokenStorageInterface $tokenStorage,
) {
}

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,
) {
}

View file

@ -18,8 +18,8 @@ class Authenticator implements LoggerAwareInterface
private $logger;
public function __construct(
private SiteConfigBuilder $configBuilder,
private LoginFormAuthenticator $authenticator,
private readonly SiteConfigBuilder $configBuilder,
private readonly LoginFormAuthenticator $authenticator,
) {
$this->logger = new NullLogger();
}

View file

@ -11,13 +11,13 @@ use Symfony\Contracts\HttpClient\ResponseStreamInterface;
class WallabagClient implements HttpClientInterface
{
private HttpClientInterface $httpClient;
private readonly HttpClientInterface $httpClient;
public function __construct(
private $restrictedAccess,
private HttpBrowser $browser,
private Authenticator $authenticator,
private LoggerInterface $logger,
private readonly HttpBrowser $browser,
private readonly Authenticator $authenticator,
private readonly LoggerInterface $logger,
) {
$this->httpClient = HttpClient::create([
'timeout' => 10,

View file

@ -22,8 +22,8 @@ class AuthCodeMailer implements AuthCodeMailerInterface
* @param string $supportUrl support URL to report any bugs
*/
public function __construct(
private MailerInterface $mailer,
private Environment $twig,
private readonly MailerInterface $mailer,
private readonly Environment $twig,
private $senderEmail,
private $senderName,
private $supportUrl,

View file

@ -22,7 +22,7 @@ class UsernameFeedTokenConverter implements ParamConverterInterface
* @param ManagerRegistry $registry Manager registry
*/
public function __construct(
private ?ManagerRegistry $registry = null,
private readonly ?ManagerRegistry $registry = null,
) {
}

View file

@ -16,7 +16,7 @@ use Simpleue\Queue\RedisQueue;
class Producer implements ProducerInterface
{
public function __construct(
private RedisQueue $queue,
private readonly RedisQueue $queue,
) {
}

View file

@ -16,7 +16,7 @@ class SiteCredentialRepository extends ServiceEntityRepository
{
public function __construct(
ManagerRegistry $registry,
private CryptoProxy $cryptoProxy,
private readonly CryptoProxy $cryptoProxy,
) {
parent::__construct($registry, SiteCredential::class);
}

View file

@ -16,7 +16,7 @@ class TagRepository extends ServiceEntityRepository
{
public function __construct(
ManagerRegistry $registry,
private string $tablePrefix,
private readonly string $tablePrefix,
) {
parent::__construct($registry, Tag::class);
}

View file

@ -15,7 +15,7 @@ class AdminVoter extends Voter
public const CREATE_IGNORE_ORIGIN_INSTANCE_RULES = 'CREATE_IGNORE_ORIGIN_INSTANCE_RULES';
public function __construct(
private Security $security,
private readonly Security $security,
) {
}

View file

@ -13,7 +13,7 @@ class IgnoreOriginInstanceRuleVoter extends Voter
public const DELETE = 'DELETE';
public function __construct(
private Security $security,
private readonly Security $security,
) {
}

View file

@ -22,7 +22,7 @@ class MainVoter extends Voter
public const EDIT_CONFIG = 'EDIT_CONFIG';
public function __construct(
private Security $security,
private readonly Security $security,
) {
}

View file

@ -15,7 +15,7 @@ class TagVoter extends Voter
public const DELETE = 'DELETE';
public function __construct(
private Security $security,
private readonly Security $security,
) {
}

View file

@ -13,7 +13,7 @@ class UserVoter extends Voter
public const DELETE = 'DELETE';
public function __construct(
private Security $security,
private readonly Security $security,
) {
}

View file

@ -13,10 +13,10 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
* GrabySiteConfigBuilder constructor.
*/
public function __construct(
private ConfigBuilder $grabyConfigBuilder,
private TokenStorageInterface $token,
private SiteCredentialRepository $credentialRepository,
private LoggerInterface $logger,
private readonly ConfigBuilder $grabyConfigBuilder,
private readonly TokenStorageInterface $token,
private readonly SiteCredentialRepository $credentialRepository,
private readonly LoggerInterface $logger,
) {
}

View file

@ -9,10 +9,10 @@ use Wallabag\ExpressionLanguage\AuthenticatorProvider;
class LoginFormAuthenticator
{
private ExpressionLanguage $expressionLanguage;
private readonly ExpressionLanguage $expressionLanguage;
public function __construct(
private HttpBrowser $browser,
private readonly HttpBrowser $browser,
AuthenticatorProvider $authenticatorProvider,
) {
$this->expressionLanguage = new ExpressionLanguage(null, [$authenticatorProvider]);

View file

@ -16,13 +16,13 @@ use Wallabag\Repository\TagRepository;
class WallabagExtension extends AbstractExtension implements GlobalsInterface
{
public function __construct(
private EntryRepository $entryRepository,
private AnnotationRepository $annotationRepository,
private TagRepository $tagRepository,
private TokenStorageInterface $tokenStorage,
private readonly EntryRepository $entryRepository,
private readonly AnnotationRepository $annotationRepository,
private readonly TagRepository $tagRepository,
private readonly TokenStorageInterface $tokenStorage,
private $lifeTime,
private TranslatorInterface $translator,
private string $projectDir,
private readonly TranslatorInterface $translator,
private readonly string $projectDir,
) {
}