Skip to content

Commit c5a830b

Browse files
committed
Ran php-cs-fixer
1 parent 26ff33a commit c5a830b

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/DateTime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private function compile(string $date, string $format, string $timezone = 'null'
2424
PHP;
2525
}
2626

27-
private function evaluate(array $context, string $date, string $format, string $timezone = null)
27+
private function evaluate(array $context, string $date, string $format, ?string $timezone = null)
2828
{
2929
return \DateTimeImmutable::createFromFormat($format, $date, null !== $timezone ? new \DateTimeZone($timezone) : null);
3030
}

src/FileExtension.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@ private function compile(string $value): string
2121
{
2222
return <<<PHP
2323
(function () use (\$input) : string {
24-
\$parts = explode('.', basename($value));
25-
26-
return end(\$parts);
24+
return \\pathinfo($value, \FILEINFO_EXTENSION)
2725
})()
2826
PHP;
2927
}
3028

31-
private function evaluate(array $context, string $imageUrl): string
29+
private function evaluate(array $context, string $file): string
3230
{
33-
$parts = explode('.', basename($imageUrl));
34-
35-
return end($parts);
31+
return pathinfo($file, \FILEINFO_EXTENSION);
3632
}
3733
}

src/Now.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ public function __construct($name)
1717
);
1818
}
1919

20-
private function compile(string $timezone = null): string
20+
private function compile(?string $timezone = null): string
2121
{
2222
return <<<PHP
2323
(new \\DateTime('now', {$timezone} !== null ? new \\DateTimeZone({$timezone}) : null))
2424
PHP;
2525
}
2626

27-
private function evaluate(array $context, string $timezone = null)
27+
private function evaluate(array $context, ?string $timezone = null)
2828
{
2929
return new \DateTime('now', null !== $timezone ? new \DateTimeZone($timezone) : null);
3030
}

0 commit comments

Comments
 (0)