Get support for PedroTroller/SymfonyIntegrationChecker

If you're new to LTH, please see our FAQ for more information on what it is we do.

Support Options

Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:

View Open Issues

Take a look to see if anyone else has experienced the same issue as you and if they managed to solve it.

Open an Issue

Make sure to read any relevant guidelines for opening issues on this repo before posting a new issue.

Sponsor directly

Check out the page and see if there are any options to sponsor this project or it's developers directly.

PedroTroller/SymfonyIntegrationChecker

SYMFONY Integration Checker

Installation

$ composer require pedrotroller/symfony-integration-checker --dev

Usage

You just have to create a .symfony_checker. This script should return a callback. This callback will have an instance of PedroTroller\Symfony\IntegrationChecker\ConfigurableKernel as parameter.

use PedroTroller\Symfony\IntegrationChecker\ConfigurableKernel;

return function (ConfigurableKernel $kernel) {
    // Your configuration
};

Launch the checker

$ ./bin/symfony-integration-checker check

Available kernel customization

$kernel->addBundle(BundleInterface $bundle): you can dynamically inject bundles into your kernel.

$kernel->setConfig(array $config): inject a configuration.

$kernel->setContainerBuilder(ContainerBuilder $container): inject your own container.

$kernel->afterBoot(callable $callable): inject a callable. This callable will be executed after the kernel boot.

Example

<?php

use PedroTroller\Symfony\IntegrationChecker\ConfigurableKernel;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Translation\TranslatorInterface;

$config = array(
    'framework' => array(
        'translator' => array(
            'enabled' => true,
        ),
    ),
);

$test = function (KernelInterface $kernel) {
    if (false === $kernel->getContainer()->get('translator') instanceof TranslatorInterface) {
        throw new \Exception('Oups, there is a problem !');
    }
};

return function (ConfigurableKernel $kernel) use ($config, $test) {
    $container = new ContainerBuilder();
    $container->setParameter('kernel.secret', md5(time()));

    $kernel
        ->setContainerBuilder($container)
        ->setConfig($config)
        ->addBundle(new FrameworkBundle())
        ->afterBoot($test)
    ;
};
Our Mission

We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.

Interesting Articles

Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated

p-e622a1a2