PHP code example of pedrotroller / symfony-integration-checker

1. Go to this page and download the library: Download pedrotroller/symfony-integration-checker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pedrotroller / symfony-integration-checker example snippets


use PedroTroller\Symfony\IntegrationChecker\ConfigurableKernel;

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



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)
    ;
};