yiisoft /
demo
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace App\Widget; |
||
| 6 | |||
| 7 | use Yiisoft\Session\Flash\FlashInterface; |
||
|
0 ignored issues
–
show
|
|||
| 8 | use Yiisoft\Widget\Widget; |
||
|
0 ignored issues
–
show
The type
Yiisoft\Widget\Widget 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...
|
|||
| 9 | use Yiisoft\Yii\Bootstrap5\Alert; |
||
|
0 ignored issues
–
show
The type
Yiisoft\Yii\Bootstrap5\Alert 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 FlashMessage extends Widget |
||
| 12 | { |
||
| 13 | public function __construct(private FlashInterface $flash) |
||
| 14 | { |
||
| 15 | } |
||
| 16 | |||
| 17 | public function render(): string |
||
| 18 | { |
||
| 19 | $flashes = $this->flash->getAll(); |
||
| 20 | |||
| 21 | $html = []; |
||
| 22 | foreach ($flashes as $type => $data) { |
||
| 23 | foreach ($data as $message) { |
||
| 24 | $html[] = Alert::widget() |
||
| 25 | ->options(['class' => "alert-{$type} shadow"]) |
||
| 26 | ->body($message['body']); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | return implode($html); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |
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