Skip to content

Instantly share code, notes, and snippets.


Yan Ivanov franzose

View GitHub Profile
View doctrine.yaml
# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
# configure these for your database server
fesor /
Last active Oct 1, 2021
What is OOP

Что такое ООП

Ссылки на материалы, позволяющее лучше понять оригинальную идею.


Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to hit computing since MS-DOS.

Alan Kay

vudaltsov / Condition.php
Last active Sep 22, 2021
Conditional validator
View Condition.php
namespace App\Validator\Constraints;
use Symfony\Component\Validator\Constraints\Composite;
* @Annotation()
View AspectOperators.kt
// Aspect interface for combinator
interface Aspect {
operator fun <R> invoke(block: () -> R): R
// Aspect combinator
operator fun Aspect) = object : Aspect {
override fun <R> invoke(block: () -> R): R =
this@plus {
other {
enleur / ConstraintViolationsConverter.php
Last active May 18, 2022
Symfony json body to request object auto mapping
View ConstraintViolationsConverter.php
namespace App\Request\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Validator\ConstraintViolationListInterface;
final class ConstraintViolationsConverter implements ParamConverterInterface
fesor /
Created Jul 25, 2018
Symfony without ORM

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

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

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

saqueib / errorHandler.js
Last active May 9, 2022
Global error handling using axios interceptor for http calls
View errorHandler.js
import axios from 'axios'
import toast from './toast'
function errorResponseHandler(error) {
// check for errorHandle config
if( error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false ) {
return Promise.reject(error);
// if has response show the error
View SymfonyLoopedCommand.php
namespace App\Command;
use App\Symfony\EventDispatcher;
use Doctrine\DBAL\Driver\Connection;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\ConsoleEvents;
gskema / BulkInsertQuery.php
Last active Apr 18, 2022
PHP PDO / Doctrine DBAL bulk insert query
View BulkInsertQuery.php
namespace YourApp\Repository\Query;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Schema\Identifier;
* Class BulkInsertQuery
boekkooi / CustomPropertyAccessor.php
Last active Dec 23, 2020
Using a custom property path for symfony forms set / get path
View CustomPropertyAccessor.php
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\PropertyAccess\PropertyPath;
* A property accessor that allows you to rewrite a property path for setters and getters.
class CustomPropertyAccessor extends PropertyAccessor