1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-26 18:21:02 +00:00

Migrate to constructor promoted properties

This commit is contained in:
Yassine Guedidi 2025-04-05 13:54:27 +02:00
parent 4168727f36
commit 1d5674a230
85 changed files with 441 additions and 854 deletions

View file

@ -10,17 +10,12 @@ use Symfony\Component\Form\DataTransformerInterface;
*/
class StringToListTransformer implements DataTransformerInterface
{
/**
* @var string
*/
private $separator;
/**
* @param string $separator The separator used in the list
*/
public function __construct($separator = ',')
{
$this->separator = $separator;
public function __construct(
private $separator = ',',
) {
}
/**

View file

@ -14,17 +14,14 @@ use Wallabag\Entity\Config;
class ConfigType extends AbstractType
{
private $languages = [];
private $fonts = [];
/**
* @param array $languages Languages come from configuration, array just code language as key and label as value
* @param array $fonts Fonts come from configuration, array just font name as key / value
*/
public function __construct($languages, $fonts)
{
$this->languages = $languages;
$this->fonts = $fonts;
public function __construct(
private $languages,
private $fonts,
) {
}
public function buildForm(FormBuilderInterface $builder, array $options)

View file

@ -21,16 +21,13 @@ use Wallabag\Repository\EntryRepository;
class EntryFilterType extends AbstractType
{
private $repository;
private $tokenStorage;
/**
* Repository & user are used to get a list of language entries for this user.
*/
public function __construct(EntryRepository $entryRepository, TokenStorageInterface $tokenStorage)
{
$this->repository = $entryRepository;
$this->tokenStorage = $tokenStorage;
public function __construct(
private EntryRepository $repository,
private TokenStorageInterface $tokenStorage,
) {
}
public function buildForm(FormBuilderInterface $builder, array $options)