Skip to content

Commit b487ffc

Browse files
committed
Bump to L5.5 minimum
1 parent 97b6cf1 commit b487ffc

File tree

7 files changed

+21
-37
lines changed

7 files changed

+21
-37
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
language: php
22

33
php:
4-
- 5.5
5-
- 5.6
64
- 7.0
75
- 7.1
6+
- 7.2
87

98
cache:
109
directories:

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
"email": "nekrasov.ilya90@gmail.com"
1010
}
1111
],
12-
"homepage": "https://github.com/Arrilot/laravel-widgets",
12+
"homepage": "https://github.com/arrilot/laravel-widgets",
1313
"require": {
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",
20-
"illuminate/cache": ">=5.1"
14+
"php": ">=7.0",
15+
"illuminate/support": ">=5.5",
16+
"illuminate/contracts": ">=5.5",
17+
"illuminate/view": ">=5.5",
18+
"illuminate/container": ">=5.5",
19+
"illuminate/console": ">=5.5",
20+
"illuminate/cache": ">=5.5"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "~4.0"
23+
"phpunit/phpunit": "~6.0"
2424
},
2525
"autoload": {
2626
"psr-4": {

src/Misc/LaravelApplicationWrapper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ public function getNamespace()
8888
*/
8989
public function make($abstract, array $parameters = [])
9090
{
91-
return method_exists($app, 'makeWith')
92-
? $app->makeWith($abstract, $parameters)
93-
: $app->make($abstract, $parameters);
91+
return $this->app->make($abstract, $parameters);
9492
}
9593
}

src/ServiceProvider.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,16 @@ public function boot()
6767
});
6868
}
6969

70-
$omitParenthesis = version_compare($this->app->version(), '5.3', '<');
71-
72-
Blade::directive('widget', function ($expression) use ($omitParenthesis) {
73-
$expression = $omitParenthesis ? $expression : "($expression)";
74-
75-
return "<?php echo app('arrilot.widget')->run{$expression}; ?>";
70+
Blade::directive('widget', function ($expression) {
71+
return "<?php echo app('arrilot.widget')->run($expression); ?>";
7672
});
7773

78-
Blade::directive('asyncWidget', function ($expression) use ($omitParenthesis) {
79-
$expression = $omitParenthesis ? $expression : "($expression)";
80-
81-
return "<?php echo app('arrilot.async-widget')->run{$expression}; ?>";
74+
Blade::directive('asyncWidget', function ($expression) {
75+
return "<?php echo app('arrilot.async-widget')->run($expression); ?>";
8276
});
8377

84-
Blade::directive('widgetGroup', function ($expression) use ($omitParenthesis) {
85-
$expression = $omitParenthesis ? $expression : "($expression)";
86-
87-
return "<?php echo app('arrilot.widget-group-collection')->group{$expression}->display(); ?>";
78+
Blade::directive('widgetGroup', function ($expression) {
79+
return "<?php echo app('arrilot.widget-group-collection')->group($expression)->display(); ?>";
8880
});
8981
}
9082

tests/Support/TestApplicationWrapper.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,8 @@ public function make($abstract, array $parameters = [])
101101

102102
if (is_subclass_of($abstract, AbstractWidget::class)) {
103103
$app = Container::getInstance();
104-
if (!$app) {
105-
$app = Container::setInstance(new Container());
106-
}
107104

108-
return method_exists($app, 'makeWith')
109-
? $app->makeWith($abstract, $parameters)
110-
: $app->make($abstract, $parameters);
105+
return $app->make($abstract, $parameters);
111106
}
112107

113108
throw new InvalidArgumentException("Binding {$abstract} cannot be resolved while testing");

tests/Support/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace Arrilot\Widgets\Test\Support;
44

55
use Arrilot\Widgets\WidgetId;
6-
use PHPUnit_Framework_TestCase;
6+
use PHPUnit\Framework\TestCase as BaseTestCase;
77

8-
class TestCase extends PHPUnit_Framework_TestCase
8+
class TestCase extends BaseTestCase
99
{
1010
public function tearDown()
1111
{

tests/WidgetFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function setUp()
2121

2222
public function testItThrowsExceptionForBadWidgetClass()
2323
{
24-
$this->setExpectedException('\Arrilot\Widgets\Misc\InvalidWidgetClassException');
24+
$this->expectException('\Arrilot\Widgets\Misc\InvalidWidgetClassException');
2525

2626
$this->factory->run('testBadSlider');
2727
}

0 commit comments

Comments
 (0)