Completed
Pull Request — master (#18)
by Paulo Rodrigues
03:15
created

RjFrontendBundle.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Rj\FrontendBundle;
4
5
use Rj\FrontendBundle\Util\Util;
6
use Rj\FrontendBundle\DependencyInjection\Compiler\Packages\AssetCompilerPass;
7
use Rj\FrontendBundle\DependencyInjection\Compiler\Packages\TemplatingCompilerPass;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\HttpKernel\Bundle\Bundle;
10
use Symfony\Component\Console\Application;
11
use Symfony\Bundle\FrameworkBundle\Console\Application as FrameworkApplication;
12
13 22
class RjFrontendBundle extends Bundle
14
{
15 22
    public function build(ContainerBuilder $container)
16
    {
17 22
        parent::build($container);
18 11
19
        if (Util::hasAssetComponent()) {
20 11
            $container->addCompilerPass(new AssetCompilerPass());
21
        } else {
22 22
            $container->addCompilerPass(new TemplatingCompilerPass());
23
        }
24
    }
25
26
    public function registerCommands(Application $app)
27
    {
28
        if ($app instanceof FrameworkApplication) {
29
            $this->addConsoleHelpers($app);
30
        }
31
32
        return parent::registerCommands($app);
33
    }
34
35
    private function addConsoleHelpers(FrameworkApplication $app)
36
    {
37
        if (!Util::hasQuestionHelper()) {
38
            $app->getHelperSet()->set($app->getContainer()->get('rj_frontend.console.helper.question_legacy'), 'question');
0 ignored issues
show
The method getContainer() does not seem to exist on object<Symfony\Bundle\Fr...le\Console\Application>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
        }
40
    }
41
}
42