Skip to content

Commit b115c03

Browse files
author
root
committed
Laravel 5.4 compatibility
1 parent 852b1ed commit b115c03

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ php:
44
- 5.5
55
- 5.6
66
- 7.0
7-
- hhvm
7+
- 7.1
8+
9+
cache:
10+
directories:
11+
- $HOME/.composer/cache
812

913
before_script:
1014
- composer self-update

src/Console/WidgetMakeCommand.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22

33
namespace Arrilot\Widgets\Console;
44

5-
use Illuminate\Console\AppNamespaceDetectorTrait;
65
use Illuminate\Console\GeneratorCommand;
76
use Symfony\Component\Console\Input\InputOption;
87

98
class WidgetMakeCommand extends GeneratorCommand
109
{
11-
use AppNamespaceDetectorTrait;
12-
1310
/**
1411
* The console command name.
1512
*
@@ -98,7 +95,7 @@ protected function replaceNamespace(&$stub, $name)
9895
);
9996

10097
$stub = str_replace(
101-
'{{rootNamespace}}', $this->getAppNamespace(), $stub
98+
'{{rootNamespace}}', $this->laravel->getNamespace(), $stub
10299
);
103100

104101
return $this;
@@ -194,7 +191,7 @@ protected function getViewPath()
194191
*/
195192
protected function makeViewName()
196193
{
197-
$name = str_replace($this->getAppNamespace(), '', $this->argument('name'));
194+
$name = str_replace($this->laravel->getNamespace(), '', $this->argument('name'));
198195
$name = str_replace('\\', '/', $name);
199196

200197
// convert to snake_case part by part to avoid unexpected underscores.

src/Misc/LaravelApplicationWrapper.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44

55
use Arrilot\Widgets\Contracts\ApplicationWrapperContract;
66
use Closure;
7-
use Illuminate\Console\AppNamespaceDetectorTrait;
87
use Illuminate\Container\Container;
98

109
class LaravelApplicationWrapper implements ApplicationWrapperContract
1110
{
12-
use AppNamespaceDetectorTrait;
13-
1411
/**
1512
* Laravel application instance.
1613
*/
@@ -71,7 +68,7 @@ public function config($key, $default = null)
7168
*/
7269
public function getNamespace()
7370
{
74-
return $this->getAppNamespace();
71+
return $this->app->getNamespace();
7572
}
7673

7774
/**

src/ServiceProvider.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
use Arrilot\Widgets\Factories\AsyncWidgetFactory;
77
use Arrilot\Widgets\Factories\WidgetFactory;
88
use Arrilot\Widgets\Misc\LaravelApplicationWrapper;
9-
use Illuminate\Console\AppNamespaceDetectorTrait;
109
use Illuminate\Support\Facades\Blade;
1110

1211
class ServiceProvider extends \Illuminate\Support\ServiceProvider
1312
{
14-
use AppNamespaceDetectorTrait;
15-
1613
/**
1714
* Register the service provider.
1815
*

0 commit comments

Comments
 (0)