These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Spatie\BladeX\ComponentDirectory; |
||
4 | |||
5 | use Symfony\Component\Finder\SplFileInfo; |
||
6 | |||
7 | abstract class ComponentDirectory |
||
8 | { |
||
9 | abstract function getAbsoluteDirectory(): string; |
||
0 ignored issues
–
show
|
|||
10 | |||
11 | public function getViewName(SplFileInfo $viewFile): string |
||
12 | { |
||
13 | $view = str_replace_last('.blade.php', '', $viewFile->getFilename()); |
||
14 | |||
15 | return "{$this->viewDirectory}.{$view}"; |
||
0 ignored issues
–
show
The property
viewDirectory does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
Loading history...
|
|||
16 | } |
||
17 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.