Completed
Push — master ( 7ac6a5...2a89ae )
by Wachter
06:40
created

TestHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
use Symfony\Component\Config\FileLocator;
4
use Symfony\Component\Config\Loader\LoaderInterface;
5
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
6
use Symfony\Component\HttpKernel\Kernel;
7
use Task\TaskBundle\TaskBundle;
8
9
class TestKernel extends Kernel
10
{
11
    const STORAGE_VAR_NAME = 'STORAGE';
12
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function registerBundles()
17
    {
18
        return [
19
            new TaskBundle(),
20
        ];
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function registerContainerConfiguration(LoaderInterface $loader)
27
    {
28
        $loader->load(sprintf('%s/config/config.%s.yml', __DIR__, getenv(self::STORAGE_VAR_NAME)));
29
    }
30
31
    protected function buildContainer()
32
    {
33
        $container = parent::buildContainer();
34
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config'));
35
        $loader->load('services.xml');
36
37
        return $container;
38
    }
39
}
40
41
class TestHandler implements \Task\Handler\HandlerInterface
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
42
{
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function handle($workload)
47
    {
48
        return strrev($workload);
49
    }
50
}
51