Skip to content

Commit ad0511b

Browse files
mikerogneTerrePorter
authored andcommitted
Adds support for Laravel 5.8, but maintains PHP >= 5.6.4 requirement in composer.json (#48)
Updates * Add Laravel 5.7 Support * Add support for Laravel 5.8 - from @mikerogne
1 parent 63feb6a commit ad0511b

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"autoload": {
1717
"psr-4": {
1818
"Wpb\\String_Blade_Compiler\\": "src/"
19-
}
19+
}
2020
},
2121
"minimum-stability": "dev"
2222
}

src/Compilers/BladeCompiler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ protected function compileRegularEchos($value)
3131
$whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3];
3232

3333
if ($this->contentTagsEscaped) {
34-
$wrapped = sprintf('e(%s)', $this->compileEchoDefaults($matches[2]));
34+
$wrapped = sprintf('e(%s)', $matches[2]);
3535
} else {
36-
$wrapped = sprintf('%s', $this->compileEchoDefaults($matches[2]));
36+
$wrapped = sprintf('%s', $matches[2]);
3737
}
3838

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

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

6161
return preg_replace_callback($pattern, $callback, $value);

src/StringView.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ public function getName()
7575
return (isset($this->view->template)?md5($this->view->template):'StringViewTemplate');
7676
}
7777

78+
/**
79+
* Get the array of view data.
80+
*
81+
* @return array
82+
*/
83+
public function getData()
84+
{
85+
return $this->data;
86+
}
87+
7888
/**
7989
* Get a evaluated view contents for the given view.
8090
*

0 commit comments

Comments
 (0)