Completed
Push — develop ( 301e45...41ed2b )
by Luke
04:02
created

ContainerAwareTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setContainer() 0 3 1
1
<?php
2
3
/**
4
 * Moodle component manager.
5
 *
6
 * @author Luke Carrier <[email protected]>
7
 * @copyright 2016 Luke Carrier
8
 * @license GPL-3.0+
9
 */
10
11
namespace ComponentManager\DependencyInjection;
12
13
use Symfony\Component\DependencyInjection\ContainerInterface;
14
15
trait ContainerAwareTrait {
16
    /**
17
     * Dependency injection container.
18
     *
19
     * @var \Symfony\Component\DependencyInjection\ContainerInterface
20
     */
21
    protected $container;
22
23
    /**
24
     * Set the dependency injection container.
25
     *
26
     * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
0 ignored issues
show
Documentation introduced by
Should the type for parameter $container not be null|ContainerInterface?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 80 characters; contains 82 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
27
     *
28
     * @return void
29
     */
30
    public function setContainer(ContainerInterface $container=null) {
31
        $this->container = $container;
32
    }
33
}
34