Completed
Push — master ( d29062...de4eee )
by Alexey
9s
created

JobResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A resolve() 0 4 1
1
<?php
2
3
namespace SfCod\QueueBundle\Service;
4
5
use SfCod\QueueBundle\Base\JobInterface;
6
use SfCod\QueueBundle\Base\JobResolverInterface;
7
use Symfony\Component\DependencyInjection\ContainerInterface;
8
9
/**
10
 * Class JobResolver
11
 *
12
 * @author Virchenko Maksim <[email protected]>
13
 *
14
 * @package SfCod\QueueBundle\Service
15
 */
16
class JobResolver implements JobResolverInterface
17
{
18
    /**
19
     * @var ContainerInterface
20
     */
21
    protected $container;
22
23
    /**
24
     * JobResolver constructor.
25
     *
26
     * @param ContainerInterface $container
27
     */
28
    public function __construct(ContainerInterface $container)
29
    {
30
        $this->container = $container;
31
    }
32
33
    /**
34
     * Resolve the given class.
35
     *
36
     * @param string $class
37
     *
38
     * @return JobInterface
39
     */
40
    public function resolve(string $class): JobInterface
41
    {
42
        return $this->container->get($class);
43
    }
44
}
45