Skip to content

Instantly share code, notes, and snippets.

View yann-eugone's full-sized avatar
👺
Yoooo

Yann Eugoné yann-eugone

👺
Yoooo
View GitHub Profile
@yann-eugone
yann-eugone / phpstorm-templates.md
Last active September 19, 2023 06:08
PhpStorm Live Templates

tryc

try / catch

try {
    $TRY$
} catch(\Throwable $exception) {
    $CATCH$
}
@yann-eugone
yann-eugone / formulas.php
Last active December 15, 2020 10:39
Formula calculation using symfony/expression-language
<?php
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\ExpressionLanguage\Node\NameNode;
use Symfony\Component\ExpressionLanguage\Node\Node;
class Formula
@yann-eugone
yann-eugone / EntityTranslatorStrategy.php
Last active August 13, 2018 07:49
Automatically Register Sonata Admin services
<?php
namespace App\Admin\Translator;
use Sonata\AdminBundle\Translator\LabelTranslatorStrategyInterface;
class EntityTranslatorStrategy implements LabelTranslatorStrategyInterface
{
/**
* @var string