Issues (65)

src/Traits/RequestAwareTrait.php (2 issues)

Labels
Severity
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
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
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