Extract a start year variable for better
...readability
This commit is contained in:
parent
90c43e9780
commit
491f10103f
|
@ -8,6 +8,8 @@ use Twig\TwigFunction;
|
||||||
|
|
||||||
class ExperienceTwigExtension extends AbstractExtension
|
class ExperienceTwigExtension extends AbstractExtension
|
||||||
{
|
{
|
||||||
|
private static $startYear = 2007;
|
||||||
|
|
||||||
public function getFunctions(): array
|
public function getFunctions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +24,6 @@ class ExperienceTwigExtension extends AbstractExtension
|
||||||
|
|
||||||
public function getYearsOfExperience(): int
|
public function getYearsOfExperience(): int
|
||||||
{
|
{
|
||||||
return (new \DateTimeImmutable())->format('Y') - 2007;
|
return (new \DateTimeImmutable())->format('Y') - self::$startYear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue