Skip to content

Commit 596cad8

Browse files
committed
Drop laravel 5.0 support
1 parent c5e7d08 commit 596cad8

File tree

2 files changed

+6
-38
lines changed

2 files changed

+6
-38
lines changed

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
],
1212
"homepage": "https://github.com/Arrilot/laravel-widgets",
1313
"require": {
14-
"php": ">=5.4.0",
15-
"illuminate/support": "5.*",
16-
"illuminate/contracts": "5.*",
17-
"illuminate/view": "5.*",
18-
"illuminate/container": "5.*",
19-
"illuminate/console": "5.*"
14+
"php": ">=5.5.9",
15+
"illuminate/support": ">=5.1",
16+
"illuminate/contracts": ">=5.1",
17+
"illuminate/view": ">=5.1",
18+
"illuminate/container": ">=5.1",
19+
"illuminate/console": ">=5.1"
2020
},
2121
"require-dev": {
2222
"phpunit/phpunit": "~4.0"

src/ServiceProvider.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ public function boot()
7474
return "<?php echo app('arrilot.widget')->run{$expression}; ?>";
7575
});
7676

77-
// Blade::directive cannot recognize @async-widget, so @async-widget still use the custom matcher.
78-
$this->registerBladeDirective('async-widget', '$1<?php echo app("arrilot.async-widget")->run$2; ?>');
79-
8077
Blade::directive('asyncWidget', function ($expression) {
8178
return "<?php echo app('arrilot.async-widget')->run{$expression}; ?>";
8279
});
@@ -95,33 +92,4 @@ public function provides()
9592
{
9693
return ['arrilot.widget', 'arrilot.async-widget'];
9794
}
98-
99-
/**
100-
* Register a blade directive.
101-
*
102-
* @param $name
103-
* @param $expression
104-
*/
105-
protected function registerBladeDirective($name, $expression)
106-
{
107-
Blade::extend(function ($view) use ($name, $expression) {
108-
$pattern = $this->createMatcher($name);
109-
110-
return preg_replace($pattern, $expression, $view);
111-
});
112-
}
113-
114-
/**
115-
* Substitution for $compiler->createMatcher().
116-
*
117-
* Get the regular expression for a generic Blade function.
118-
*
119-
* @param string $function
120-
*
121-
* @return string
122-
*/
123-
protected function createMatcher($function)
124-
{
125-
return '/(?<!\w)(\s*)@'.$function.'(\s*\(.*\))/';
126-
}
12795
}

0 commit comments

Comments
 (0)