Code Duplication    Length = 16-17 lines in 2 locations

GoAopBundle.php 1 location

@@ 40-55 (lines=16) @@
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function boot()
41
    {
42
        // it is a quick way to check if loader was enabled
43
        $wasDebugEnabled = class_exists(DebugClassLoader::class, false);
44
        if ($wasDebugEnabled) {
45
            // disable temporary to apply AOP loader first
46
            DebugClassLoader::disable();
47
        }
48
        $this->container->get('goaop.aspect.container');
49
        if (!AopComposerLoader::wasInitialized()) {
50
            throw new \RuntimeException("Initialization of AOP loader was failed, probably due to Debug::enable()");
51
        }
52
        if ($wasDebugEnabled) {
53
            DebugClassLoader::enable();
54
        }
55
    }
56
}
57

Kernel/AspectSymfonyKernel.php 1 location

@@ 37-53 (lines=17) @@
34
     *
35
     * @inheritDoc
36
     */
37
    public function init(array $options = [])
38
    {
39
        // it is a quick way to check if loader was enabled
40
        $wasDebugEnabled = class_exists(DebugClassLoader::class, false);
41
        if ($wasDebugEnabled) {
42
            // disable temporary to apply AOP loader first
43
            DebugClassLoader::disable();
44
        }
45
        parent::init($options);
46
47
        if (!AopComposerLoader::wasInitialized()) {
48
            throw new \RuntimeException("Initialization of AOP loader was failed, probably due to Debug::enable()");
49
        }
50
        if ($wasDebugEnabled) {
51
            DebugClassLoader::enable();
52
        }
53
    }
54
}
55