bytic /
view
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Nip\View\Traits; |
||
| 6 | |||
| 7 | use Nip\Mvc\Modules; |
||
|
0 ignored issues
–
show
|
|||
| 8 | use ReflectionClass; |
||
| 9 | use function dirname; |
||
| 10 | use const DIRECTORY_SEPARATOR; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Class ModuleView. |
||
| 14 | */ |
||
| 15 | trait ModuleView |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @return string |
||
| 19 | */ |
||
| 20 | protected function generateBasePath() |
||
| 21 | { |
||
| 22 | $folderPath = $this->generateFolderBasePath(); |
||
| 23 | if (is_dir($folderPath)) { |
||
| 24 | return $folderPath; |
||
| 25 | } |
||
| 26 | |||
| 27 | return $this->generateModuleBasePath(); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return string |
||
| 32 | */ |
||
| 33 | public function generateModuleBasePath() |
||
| 34 | { |
||
| 35 | /** @var Modules $modules */ |
||
| 36 | $modules = app('mvc.modules'); |
||
| 37 | |||
| 38 | return $modules->getViewPath($this->getModuleName()); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | public function generateFolderBasePath() |
||
| 45 | { |
||
| 46 | $reflector = new ReflectionClass(static::class); |
||
| 47 | $dirName = dirname($reflector->getFileName()); |
||
| 48 | |||
| 49 | return dirname($dirName, 2) . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function getModuleName() |
||
| 56 | { |
||
| 57 | return 'default'; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |
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