Extract a start year variable for better

...readability
This commit is contained in:
Oliver Davies 2024-08-04 12:39:48 +01:00
parent 90c43e9780
commit 491f10103f

View file

@ -8,6 +8,8 @@ use Twig\TwigFunction;
class ExperienceTwigExtension extends AbstractExtension
{
private static $startYear = 2007;
public function getFunctions(): array
{
return [
@ -22,6 +24,6 @@ class ExperienceTwigExtension extends AbstractExtension
public function getYearsOfExperience(): int
{
return (new \DateTimeImmutable())->format('Y') - 2007;
return (new \DateTimeImmutable())->format('Y') - self::$startYear;
}
}