8000 minor #43875 [TwigBundle] Add types to private properties (derrabus) · symfony/symfony@60d12a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 60d12a9

Browse files
minor #43875 [TwigBundle] Add types to private properties (derrabus)
This PR was merged into the 6.0 branch. Discussion ---------- [TwigBundle] Add types to private properties | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Commits ------- d38b840 [TwigBundle] Add types to private properties
2 parents 7d7669e + d38b840 commit 60d12a9

File tree

3 files changed

+15
-17
lines changed
  • src/Symfony/Bundle/TwigBundle
    • CacheWarmer
  • DependencyInjection/Configurator
  • 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;
    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/Bun 8000 dle/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