8000 [TwigBundle] Add types to private properties · symfony/symfony@d38b840 · GitHub
[go: up one dir, main page]

Skip to content

Commit d38b840

Browse files
committed
[TwigBundle] Add types to private properties
1 parent 0cd2117 commit d38b840

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
*/
2525
class TemplateCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2626
{
27-
private $container;
28-
private $twig;
29-
private $iterator;
27+
private ContainerInterface $container;
28+
private Environment $twig;
29+
private iterable $iterator;
3030

3131
public function __construct(ContainerInterface $container, iterable $iterator)
3232
{
@@ -42,9 +42,7 @@ public function __construct(ContainerInterface $container, iterable $iterator)
4242
*/
4343
public function warmUp(string $cacheDir): array
4444
{
45-
if (null === $this->twig) {
46-
$this->twig = $this->container->get('twig');
47-
}
45+
$this->twig ??= $this->container->get('twig');
4846

4947
$files = [];
5048

src/Symfony/Bundle/TwigBundle/DependencyInjection/Configurator/EnvironmentConfigurator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ class_exists(Environment::class);
2424
*/
2525
class EnvironmentConfigurator
2626
{
27-
private $dateFormat;
28-
private $intervalFormat;
29-
private $timezone;
30-
private $decimals;
31-
private $decimalPoint;
32-
private $thousandsSeparator;
27+
private string $dateFormat;
28+
private string $intervalFormat;
< 8000 /td>
29+
private ?string $timezone;
30+
private int $decimals;
31+
private string $decimalPoint;
32+
private string $thousandsSeparator;
3333

3434
public function __construct(string $dateFormat, string $intervalFormat, ?string $timezone, int $decimals, string $decimalPoint, string $thousandsSeparator)
3535
{

src/Symfony/Bundle/TwigBundle/TemplateIterator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
*/
2424
class TemplateIterator implements \IteratorAggregate
2525
{
26-
private $kernel;
27-
private $templates;
28-
private $paths;
29-
private $defaultPath;
26+
private KernelInterface $kernel;
27+
private \Traversable $templates;
28+
private array $paths;
29+
private ?string $defaultPath;
3030

3131
/**
3232
* @param array $paths Additional Twig paths to warm
@@ -41,7 +41,7 @@ public function __construct(KernelInterface $kernel, array $paths = [], string $
4141

4242
public function getIterator(): \Traversable
4343
{
44-
if (null !== $this->templates) {
44+
if (isset($this->templates)) {
4545
return $this->templates;
4646
}
4747

0 commit comments

Comments
 (0)
0