1
0
mirror of https://github.com/wintercms/winter.git synced 2024-06-28 05:33:29 +02:00

View Maker guessed paths can be null

This commit is contained in:
Ben Thomson 2022-05-12 09:10:24 +08:00
parent e6440daf05
commit a64422be20

@ -272,7 +272,7 @@ trait ViewMaker
* @param string $suffix An extra path to attach to the end
* @param bool $isPublic Returns public path instead of an absolute one
*/
public function guessViewPath(string $suffix = '', bool $isPublic = false): string
public function guessViewPath(string $suffix = '', bool $isPublic = false): ?string
{
$class = get_called_class();
return $this->guessViewPathFrom($class, $suffix, $isPublic);
@ -284,7 +284,7 @@ trait ViewMaker
* @param string $suffix An extra path to attach to the end
* @param bool $isPublic Returns public path instead of an absolute one
*/
public function guessViewPathFrom(string $class, string $suffix = '', bool $isPublic = false): string
public function guessViewPathFrom(string $class, string $suffix = '', bool $isPublic = false): ?string
{
$classFolder = strtolower(class_basename($class));
$classFile = realpath(dirname(File::fromClass($class)));