1 | <?php |
||||
2 | |||||
3 | namespace Juddling\RouteChecker; |
||||
4 | |||||
5 | use Illuminate\Support\Collection; |
||||
6 | use Illuminate\View\FileViewFinder; |
||||
0 ignored issues
–
show
|
|||||
7 | use InvalidArgumentException; |
||||
8 | |||||
9 | class FindInvalidViewCalls extends FindInvalid |
||||
10 | { |
||||
11 | /** @var Collection */ |
||||
12 | protected $viewPaths; |
||||
13 | /** @var string $nameOfArgument */ |
||||
14 | protected $nameOfArgument = 'View Path'; |
||||
15 | /** @var FileViewFinder $views */ |
||||
16 | protected $viewFinder; |
||||
17 | |||||
18 | public function __construct() |
||||
19 | { |
||||
20 | $this->viewFinder = app('view.finder'); |
||||
0 ignored issues
–
show
The function
app was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
21 | parent::__construct(); |
||||
22 | } |
||||
23 | |||||
24 | protected function getFunctionName() |
||||
25 | { |
||||
26 | return 'view'; |
||||
27 | } |
||||
28 | |||||
29 | protected function check(string $viewPath): bool |
||||
30 | { |
||||
31 | try { |
||||
32 | $this->viewFinder->find($viewPath); |
||||
33 | } catch (InvalidArgumentException $e) { |
||||
34 | return false; |
||||
35 | } |
||||
36 | |||||
37 | return true; |
||||
38 | } |
||||
39 | } |
||||
40 |
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