yiisoft /
demo
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace App\ViewInjection; |
||
| 6 | |||
| 7 | use App\Auth\Identity; |
||
| 8 | use Yiisoft\User\CurrentUser; |
||
|
0 ignored issues
–
show
|
|||
| 9 | use Yiisoft\Yii\View\Renderer\LayoutParametersInjectionInterface; |
||
|
0 ignored issues
–
show
The type
Yiisoft\Yii\View\Rendere...etersInjectionInterface 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 10 | |||
| 11 | final class LayoutViewInjection implements LayoutParametersInjectionInterface |
||
| 12 | { |
||
| 13 | public function __construct(private CurrentUser $currentUser) |
||
| 14 | { |
||
| 15 | } |
||
| 16 | |||
| 17 | public function getLayoutParameters(): array |
||
| 18 | { |
||
| 19 | $identity = $this->currentUser->getIdentity(); |
||
| 20 | |||
| 21 | return [ |
||
| 22 | 'brandLabel' => 'Yii Demo', |
||
| 23 | 'user' => $identity instanceof Identity ? $identity->getUser() : null, |
||
| 24 | ]; |
||
| 25 | } |
||
| 26 | } |
||
| 27 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths