Skip to content

Instantly share code, notes, and snippets.

View Jibbarth's full-sized avatar
🌴

Jibé Barth Jibbarth

🌴
View GitHub Profile
@Jibbarth
Jibbarth / ResolveTargetEntityListenerDecorator.php
Created August 27, 2023 15:06
[DOCTRINE] Automatically remove mappedSuperClass when resolveTargetEntity target the root model
<?php
declare(strict_types=1);
namespace App\Doctrine;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Tools\ResolveTargetEntityListener;
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
@Jibbarth
Jibbarth / index.md
Created December 9, 2023 11:38
[Sylius] Get ready to add a behat feature that use javascript

While contributing on Sylius, I had to add a test for a fix.

There was already some behat test regarding the feature, but I had trouble to get ready to launch them in my own environment, and Makefile provided by Sylius didn't help me.

Here is how I proceed.

1. Launching Sylius in test mode

First, you need to be able to launch the sylius, but in Test mode.

@Jibbarth
Jibbarth / HttpProblemNormalizer.php
Created April 10, 2024 14:03
Exception normalizer : Allow to have message of exception
<?php
declare(strict_types=1);
namespace App\Normalizer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;