Completed
Push — master ( 511642...adfacc )
by Tobias
18:01 queued 08:01
created

app/AppKernel.php (1 issue)

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
use Symfony\Component\HttpKernel\Kernel;
4
use Symfony\Component\Config\Loader\LoaderInterface;
5
6
class AppKernel extends Kernel
7
{
8
    private $projectDir;
9
10
    public function registerBundles()
11
    {
12
        $bundles = [
13
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
14
            new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
15
            new \Symfony\Bundle\TwigBundle\TwigBundle(),
16
            new \Symfony\Bundle\WebServerBundle\WebServerBundle(),
17
            new \Translation\Bundle\TranslationBundle(),
18
            new \AppBundle\AppBundle(),
19
20
            new \Translation\PlatformAdapter\Loco\Bridge\Symfony\TranslationAdapterLocoBundle(),
21
            new \Translation\PlatformAdapter\Flysystem\Bridge\Symfony\TranslationAdapterFlysystemBundle(),
22
            //new \Translation\PlatformAdapter\PhraseApp\Bridge\Symfony\TranslationAdapterPhraseAppBundle(),
0 ignored issues
show
Unused Code Comprehensibility introduced by Tobias Nyholm
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
        ];
24
25
        return $bundles;
26
    }
27
28
    public function getRootDir()
29
    {
30
        return __DIR__;
31
    }
32
33
    public function getCacheDir()
34
    {
35
        return sys_get_temp_dir().'/php-translation/var/cache/'.$this->getEnvironment();
36
    }
37
38
    public function getLogDir()
39
    {
40
        return sys_get_temp_dir().'/php-translation/var/logs';
41
    }
42
43
    public function registerContainerConfiguration(LoaderInterface $loader)
44
    {
45
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
46
        $config = getcwd().'/translation.yml';
47
        if (file_exists($config)) {
48
            $loader->load($config);
49
        }
50
    }
51
52
    /**
53
     * Gets the application root dir (path of the project's LICENSE file).
54
     *
55
     * @return string The project root dir
56
     */
57
    public function getProjectDir()
58
    {
59
        if (null === $this->projectDir) {
60
            $r = new \ReflectionObject($this);
61
            $dir = $rootDir = dirname($r->getFileName());
62
            while (!file_exists($dir.'/LICENSE')) {
63
                if ($dir === dirname($dir)) {
64
                    return $this->projectDir = parent::getProjectDir();
65
                }
66
                $dir = dirname($dir);
67
            }
68
            $this->projectDir = $dir;
69
        }
70
71
        return $this->projectDir;
72
    }
73
}
74