Passed
Push — master ( f3fcaa...2db009 )
by Oleg
04:04
created

ConsoleResolverInjector::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 10
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
1
<?php /** MicroConsoleResolverInjector */
2
3
namespace Micro\Resolver;
4
5
use Micro\Base\Exception;
6
use Micro\Base\Injector;
7
8
/**
9
 * Class ConsoleResolverInjector
10
 *
11
 * @author Oleg Lunegov <[email protected]>
12
 * @link https://github.com/linpax/microphp-framework
13
 * @copyright Copyright &copy; 2013 Oleg Lunegov
14
 * @license /LICENSE
15
 * @package Micro
16
 * @subpackage Resolver
17
 * @version 1.0
18
 * @since 1.0
19
 */
20 View Code Duplication
class ConsoleResolverInjector extends Injector
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22
    /**
23
     * @return bool
24
     * @throws Exception
25
     */
26
    public function get()
27
    {
28
        $resolver = parent::get('consoleResolver');
29
30
        if (!($resolver instanceof IResolver)) {
31
            throw new Exception('Component `resolver` not configured');
32
        }
33
34
        return $resolver;
35
    }
36
}