Simplify the directory structure
This commit is contained in:
parent
780f90b9c0
commit
1a4ff13675
4 changed files with 6 additions and 6 deletions
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Experience\TwigExtension;
|
||||
|
||||
use Sculpin\Contrib\ProxySourceCollection\ProxySourceItem;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class ExperienceTwigExtension extends AbstractExtension
|
||||
{
|
||||
private static $startYear = 2007;
|
||||
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
new TwigFunction('get_years_of_experience', [$this, 'getYearsOfExperience']),
|
||||
];
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return 'experience';
|
||||
}
|
||||
|
||||
public function getYearsOfExperience(): int
|
||||
{
|
||||
return (new \DateTimeImmutable())->format('Y') - self::$startYear;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue