Instantly share code, notes, and snippets.

View check-environment-variables.php
#!/usr/bin/env php
<?php
/**
* Checks that all environment variables are set before deploying.
*
* @author Beno!t POLASZEK - 2018
* @link https://gist.github.com/bpolaszek/559dbc341dec51303fc0dea8162cf735#gistcomment-2747882
*/
View CleanAssociationsTrait.php
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Event\LifecycleEventArgs;
/**
* Trait CleanAssociationsTrait
*
* This trait is intended to fix the Doctrine ManyToOne relationships when the stored value in database is a 0 instead of NULL.
* Sometimes you plug Doctrine on an existing database without foreign key support.