Skip to content

Instantly share code, notes, and snippets.

Sergey Protko fesor

Block or report user

Report or block fesor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
fesor /
Created Jul 25, 2018
Symfony without ORM

Удобный менеджмент миграций с Symfony и Doctrine

Мало кто знает, но что бы работал migration:diff вам не нужно ставить ORM.

Что бы это работало объявим простой сервис:

fesor / ContainerReturnTypePlugin.php
Last active Oct 31, 2018
Phan plugins for Symfony and Doctrine
View ContainerReturnTypePlugin.php
use Phan\CodeBase;
use Phan\Language\Context;
use Phan\Language\UnionType;
use Phan\PluginV2\ReturnTypeOverrideCapability;
use Phan\Language\Element\Method;
use Phan\PluginV2;
use \Phan\Language\FQSEN\FullyQualifiedClassName;
use Phan\Language\Element\Clazz;
fesor / pre-commit
Last active Jul 29, 2019
php-cs-fixer pre-commit hook
View pre-commit
#!/usr/bin/env bash
echo "php-cs-fixer pre commit hook start"
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')
if [ -n "$CHANGED_FILES" ]; then
fesor /
Created Aug 19, 2017
Возвращаясь к основам: почему юнит тесты это сложно

Back to Basics: Why Unit Testing is Hard

перевод адаптирован под 2017-ый, где у нас нет проблем с mock фреймворками, и нам не обязательно создавать интерфейс дабы сделать мок.

Возвращаясь к основам: почему юнит тесты это сложно

fesor / AppExtension.php
Created Aug 18, 2016
Symfony: Service auto registration
View AppExtension.php
namespace App\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Finder\Finder;
class AppExtension extends Extension
View Scope.php
namespace Fesor\Caffeine;
final class Scope
private $payload;
private $parent;
View DefaultMyStuffMaker.php
class DefaultMyStuffMaker implements MyStuffMaker
private $dependency;
public function __construct(SomeDependency $dependency)
$this->dependency = $dependency;
fesor /
Last active Jun 4, 2019
Годное чтиво
fesor /
Last active Jan 29, 2019
Symfony Request Object

Symfony Request Object

This is proof-of-concept implementation of laravel's like form requests.


Most of Symfony developers uses forms to map request data to some Data Transfer Object. This object then passes to validator and system start to work with validated data converted to be compatible with application model.

You can’t perform that action at this time.