bytic /
router
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Nip\Router\Generator\Traits; |
||||
| 4 | |||||
| 5 | use Nip\Request; |
||||
| 6 | use Nip\Router\RequestContext; |
||||
| 7 | |||||
| 8 | /** |
||||
| 9 | * Trait HasRequestTrait |
||||
| 10 | * @package Nip\Router\Generator\Traits |
||||
| 11 | */ |
||||
| 12 | trait HasRequestTrait |
||||
| 13 | { |
||||
| 14 | |||||
| 15 | /** |
||||
| 16 | * Set the current request instance. |
||||
| 17 | * |
||||
| 18 | * @param Request $request |
||||
| 19 | */ |
||||
| 20 | public function setRequest(Request $request) |
||||
| 21 | { |
||||
| 22 | $context = (new RequestContext())->fromRequest($request); |
||||
| 23 | |||||
| 24 | $this->cachedRoot = null; |
||||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||||
| 25 | $this->cachedSchema = null; |
||||
|
0 ignored issues
–
show
|
|||||
| 26 | return $this->setContext($context); |
||||
|
0 ignored issues
–
show
It seems like
setContext() 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
Loading history...
|
|||||
| 27 | } |
||||
| 28 | } |
||||
| 29 |