Skip to content

Commit

Permalink
Adds support for Laravel 5.8, but maintains PHP >= 5.6.4 requirement …
Browse files Browse the repository at this point in the history
…in composer.json (#48)

Updates

* Add Laravel 5.7 Support
* Add support for Laravel 5.8
- from @mikerogne
  • Loading branch information
mikerogne authored and TerrePorter committed Mar 19, 2019
1 parent 63feb6a commit ad0511b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"autoload": {
"psr-4": {
"Wpb\\String_Blade_Compiler\\": "src/"
}
}
},
"minimum-stability": "dev"
}
6 changes: 3 additions & 3 deletions src/Compilers/BladeCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ protected function compileRegularEchos($value)
$whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3];

if ($this->contentTagsEscaped) {
$wrapped = sprintf('e(%s)', $this->compileEchoDefaults($matches[2]));
$wrapped = sprintf('e(%s)', $matches[2]);
} else {
$wrapped = sprintf('%s', $this->compileEchoDefaults($matches[2]));
$wrapped = sprintf('%s', $matches[2]);
}

return $matches[1] ? substr($matches[0], 1) : '<?php echo '.$wrapped.'; ?>'.$whitespace;
Expand All @@ -55,7 +55,7 @@ protected function compileEscapedEchos($value)
$callback = function ($matches) {
$whitespace = empty($matches[2]) ? '' : $matches[2].$matches[2];

return '<?php echo e('.$this->compileEchoDefaults($matches[1]).'); ?>'.$whitespace;
return '<?php echo e('.$matches[1].'); ?>'.$whitespace;
};

return preg_replace_callback($pattern, $callback, $value);
Expand Down
10 changes: 10 additions & 0 deletions src/StringView.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ public function getName()
return (isset($this->view->template)?md5($this->view->template):'StringViewTemplate');
}

/**
* Get the array of view data.
*
* @return array
*/
public function getData()
{
return $this->data;
}

/**
* Get a evaluated view contents for the given view.
*
Expand Down

0 comments on commit ad0511b

Please sign in to comment.