Skip to content

Commit 8ac7c19

Browse files
authored
Check path in ViewCollector (#1424)
1 parent bdfe99c commit 8ac7c19

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/DataCollector/ViewCollector.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,17 @@ public function addView(View $view)
112112
{
113113
$name = $view->getName();
114114
$path = $view->getPath();
115+
$type = '';
115116

116-
if (!is_object($path)) {
117-
if ($path) {
118-
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
119-
}
117+
if ($path && is_string($path)) {
118+
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
120119

121120
if (substr($path, -10) == '.blade.php') {
122121
$type = 'blade';
123122
} else {
124123
$type = pathinfo($path, PATHINFO_EXTENSION);
125124
}
126-
} else {
125+
} elseif (is_object($path)) {
127126
$type = get_class($view);
128127
$path = '';
129128
}

0 commit comments

Comments
 (0)