Completed
Push — master ( d0a237...a1b9c8 )
by Freek
9s
created

src/ComponentDirectory/ComponentDirectory.php (2 issues)

Upgrade to new PHP Analysis Engine

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
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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
}