Skip to content

Commit

Permalink
3.7 (#44)
Browse files Browse the repository at this point in the history
Created new branch for Laravel 5.7

Updates from @mitinsany 
 
* fix php 7.2 (#35)
* Add Laravel 5.7 Support (#41)
thanks [@mikerogne]
* update README
* update README
  • Loading branch information
mitinsany authored and TerrePorter committed Mar 19, 2019
1 parent b1b3ea0 commit 2bfd1ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
String Blade Compiler
=======================
[![Laravel 5.2](https://img.shields.io/badge/Laravel-5.2-orange.svg?style=flat-square)](http://laravel.com)
[![Laravel 5.7](https://img.shields.io/badge/Laravel-5.7-orange.svg?style=flat-square)](http://laravel.com)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://tldrlegal.com/license/mit-license)

Render Blade templates from string value.
Expand All @@ -23,6 +23,10 @@ Version 3.4 is a version for Laravel 5.4.

Version 3.5 is a version for Laravel 5.5.

Version 3.6 is a version for Laravel 5.6.

Version 3.7 is a version for Laravel 5.7.

Installation
=======================

Expand All @@ -36,7 +40,7 @@ Add the package to composer.json:
On packagist.org at https://packagist.org/packages/wpb/string-blade-compiler

Or from the console using require: composer require "wpb/string-blade-compiler"

To get versions 'composer show wpb/string-blade-compiler', such as 'dev-master, * 3.2.x-dev, 3.2.0, 3.0.x-dev, 3.0.0, 2.1.0, 2.0.x-dev, 2.0.0, 1.0.x-dev, 1.0.0'

In config\app.php, providers section:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
],
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.6.*"
"laravel/framework": "5.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

0 comments on commit 2bfd1ca

Please sign in to comment.