HasRequestTrait::setRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Nip\Utility\Traits;
4
5
use Nip\Request;
0 ignored issues
show
Bug introduced by
The type Nip\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
/**
8
 * Class HasRequest
9
 * @package Nip\Utility\Traits
10
 */
11
trait HasRequestTrait
12
{
13
    /**
14
     * @var Request
15
     */
16
    protected $_request;
17
18
    /**
19
     * @return Request
20
     */
21
    public function getRequest()
22
    {
23
        return $this->_request;
24
    }
25
26
    /**
27
     * @param Request $request
28
     * @return $this
29
     */
30
    public function setRequest($request)
31
    {
32
        $this->_request = $request;
33
        return $this;
34
    }
35
}
36