RequestAwareTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 1
eloc 4
c 3
b 1
f 0
dl 0
loc 11
ccs 0
cts 3
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A populateFromRequest() 0 4 1
1
<?php
2
3
namespace Nip\Controllers\Traits;
4
5
use Nip\Http\Request;
6
7
/**
8
 * Trait RequestAwareTrait
9
 * @package Nip\Controllers\Traits
10
 */
11
trait RequestAwareTrait
12
{
13
    use \Nip\Http\Request\RequestAwareTrait;
14
15
    /**
16
     * @param Request $request
17
     */
18
    public function populateFromRequest(Request $request)
19
    {
20
        $this->setName($request->getControllerName());
0 ignored issues
show
Bug introduced by
It seems like setName() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        $this->/** @scrutinizer ignore-call */ 
21
               setName($request->getControllerName());
Loading history...
21
        $this->setAction($request->getActionName());
0 ignored issues
show
Bug introduced by
It seems like setAction() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        $this->/** @scrutinizer ignore-call */ 
22
               setAction($request->getActionName());
Loading history...
22
    }
23
}
24