Skip to content

Commit 642f9a5

Browse files
Merge pull request #26 from saeidraei/master
laravel 6 support added
2 parents c0e154d + e235c1b commit 642f9a5

File tree

6 files changed

+17
-22
lines changed

6 files changed

+17
-22
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
}
1616
],
1717
"require": {
18-
"php": ">=5.4.0",
19-
"illuminate/view": "^5.5",
18+
"php": "^7.2",
19+
"illuminate/view": "^6.0",
2020
"zordius/lightncandy": "1.2.*"
2121
},
2222
"require-dev": {
23-
"orchestra/testbench": "~3.2",
24-
"phpunit/phpunit": "^6.0"
23+
"orchestra/testbench": "^4.0",
24+
"phpunit/phpunit": "^8.0"
2525
},
2626
"autoload": {
2727
"psr-4": {

phpunit.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
99
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false">
10+
stopOnFailure="false">
1211

1312
<testsuites>
1413
<testsuite name="Laravel Handlebars">

src/Compilers/BladeCompiler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php namespace ProAI\Handlebars\Compilers;
22

3+
use Illuminate\Support\Str;
34
use Illuminate\View\Compilers\BladeCompiler as BaseBladeCompiler;
45
use Illuminate\View\Compilers\CompilerInterface;
56

@@ -14,7 +15,7 @@ class BladeCompiler extends BaseBladeCompiler implements CompilerInterface
1415
*/
1516
protected function compileRaw($expression)
1617
{
17-
if (starts_with($expression, '(')) {
18+
if (Str::startsWith($expression, '(')) {
1819
$expression = substr($expression, 1, -1);
1920
}
2021

src/Compilers/HandlebarsCompiler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php namespace ProAI\Handlebars\Compilers;
22

3+
use Illuminate\Support\Arr;
34
use Illuminate\Support\Facades\App;
45
use Illuminate\Support\Facades\Lang;
56
use Illuminate\View\Compilers\Compiler;
@@ -104,7 +105,7 @@ public function compileString($path, $raw = false)
104105
}
105106

106107
// set raw option
107-
array_set($options, 'compile_helpers_only', $raw);
108+
Arr::set($options, 'compile_helpers_only', $raw);
108109

109110
// set language helper functions
110111
if ($this->languageHelpers) {
@@ -116,7 +117,7 @@ public function compileString($path, $raw = false)
116117
$helpers = [];
117118
}
118119

119-
array_set($options, 'helpers', $helpers);
120+
Arr::set($options, 'helpers', $helpers);
120121
}
121122

122123
// As of LightnCandy v0.91 resolving via `basedir` and `fileext` options has been stripped from LightnCandy.

tests/FunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class FunctionalTest extends TestCase
99
{
10-
public function setUp()
10+
public function setUp(): void
1111
{
1212
parent::setUp();
1313
}

tests/expected/handlebars.html

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,21 @@ <h2>by Markus Wetzel</h2>
3636
</div>
3737
</div>
3838

39-
4039
<div class="m-formItem">
4140
<label for="textarea" class="m-formItem__label">&lt;textarea&gt; Element</label>
4241
<div class="m-formItem__group">
4342
<textarea id="textarea">Test</textarea>
4443
</div>
4544
</div>
4645

47-
4846
<ul>
49-
<li>
47+
<li>
5048
One
51-
</li>
52-
53-
<li>
49+
</li>
50+
<li>
5451
Two
55-
</li>
56-
57-
<li>
52+
</li>
53+
<li>
5854
Three
59-
</li>
60-
55+
</li>
6156
</ul>
62-

0 commit comments

Comments
 (0)