mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 17:44:44 +08:00
Migrated all constructor props to property promotion when possible
This commit is contained in:
@@ -12,11 +12,8 @@ use function Symfony\Component\String\s;
|
||||
|
||||
class CocurSymfonySluggerBridge implements SluggerInterface
|
||||
{
|
||||
private SlugifyInterface $slugger;
|
||||
|
||||
public function __construct(SlugifyInterface $slugger)
|
||||
public function __construct(private SlugifyInterface $slugger)
|
||||
{
|
||||
$this->slugger = $slugger;
|
||||
}
|
||||
|
||||
public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString
|
||||
|
||||
@@ -12,11 +12,8 @@ use Throwable;
|
||||
*/
|
||||
class DoctrineBatchHelper implements DoctrineBatchHelperInterface
|
||||
{
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
public function __construct(private EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,11 +13,8 @@ use function sprintf;
|
||||
|
||||
class RedirectResponseHelper implements RedirectResponseHelperInterface
|
||||
{
|
||||
private UrlShortenerOptions $options;
|
||||
|
||||
public function __construct(UrlShortenerOptions $options)
|
||||
public function __construct(private UrlShortenerOptions $options)
|
||||
{
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
public function buildRedirectResponse(string $location): ResponseInterface
|
||||
|
||||
@@ -23,13 +23,8 @@ class UrlValidator implements UrlValidatorInterface, RequestMethodInterface
|
||||
private const CHROME_USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) '
|
||||
. 'Chrome/51.0.2704.103 Safari/537.36';
|
||||
|
||||
private ClientInterface $httpClient;
|
||||
private UrlShortenerOptions $options;
|
||||
|
||||
public function __construct(ClientInterface $httpClient, UrlShortenerOptions $options)
|
||||
public function __construct(private ClientInterface $httpClient, private UrlShortenerOptions $options)
|
||||
{
|
||||
$this->httpClient = $httpClient;
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user