Completed
Push — master ( 301e45...c7ba3c )
by Luke
11:03 queued 07:43
created

ContainerAwareTrait::setContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 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