Skip to content

Commit

Permalink
cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMessina committed Nov 12, 2024
1 parent d1af033 commit 87075c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private function compile(string $date, string $format, string $timezone = 'null'
PHP;
}

private function evaluate(array $context, string $date, string $format, string $timezone = null)
private function evaluate(array $context, string $date, string $format, ?string $timezone = null)
{
return \DateTimeImmutable::createFromFormat($format, $date, null !== $timezone ? new \DateTimeZone($timezone) : null);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Now.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public function __construct($name)
);
}

private function compile(string $timezone = null): string
private function compile(?string $timezone = null): string
{
return <<<PHP
(new \\DateTime('now', {$timezone} !== null ? new \\DateTimeZone({$timezone}) : null))
PHP;
}

private function evaluate(array $context, string $timezone = null)
private function evaluate(array $context, ?string $timezone = null)
{
return new \DateTime('now', null !== $timezone ? new \DateTimeZone($timezone) : null);
}
Expand Down
6 changes: 4 additions & 2 deletions src/TestPattern.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Kiboko\Component\StringExpressionLanguage;

class TestPattern
Expand Down Expand Up @@ -30,8 +32,8 @@ private function evaluate(array $context, string $pattern, string $subject): boo
$result = preg_match($pattern, $subject);
if (!$result) {
return false;
} else {
return true;
}

return true;
}
}

0 comments on commit 87075c6

Please sign in to comment.