Skip to content

Commit

Permalink
Merge pull request barryvdh#422 from TerrePorter/patch-1
Browse files Browse the repository at this point in the history
Update ViewCollector.php for StringBladeCompiler
  • Loading branch information
barryvdh committed Feb 18, 2016
2 parents 50ca224 + e211471 commit 72acfb1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/DataCollector/ViewCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ public function addView(View $view)
{
$name = $view->getName();
$path = $view->getPath();
if ($path) {
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
}

if (!is_object($path)) {
if ($path) {
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
}

if (substr($path, -10) == '.blade.php') {
$type = 'blade';
if (substr($path, -10) == '.blade.php') {
$type = 'blade';
} else {
$type = pathinfo($path, PATHINFO_EXTENSION);
}
} else {
$type = pathinfo($path, PATHINFO_EXTENSION);
$type = get_class($view);
$path = '';
}

if (!$this->collect_data) {
Expand Down

0 comments on commit 72acfb1

Please sign in to comment.