Skip to content

Commit

Permalink
Laravel 5.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jan 26, 2017
1 parent 852b1ed commit b115c03
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ php:
- 5.5
- 5.6
- 7.0
- hhvm
- 7.1

cache:
directories:
- $HOME/.composer/cache

before_script:
- composer self-update
Expand Down
7 changes: 2 additions & 5 deletions src/Console/WidgetMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

namespace Arrilot\Widgets\Console;

use Illuminate\Console\AppNamespaceDetectorTrait;
use Illuminate\Console\GeneratorCommand;
use Symfony\Component\Console\Input\InputOption;

class WidgetMakeCommand extends GeneratorCommand
{
use AppNamespaceDetectorTrait;

/**
* The console command name.
*
Expand Down Expand Up @@ -98,7 +95,7 @@ protected function replaceNamespace(&$stub, $name)
);

$stub = str_replace(
'{{rootNamespace}}', $this->getAppNamespace(), $stub
'{{rootNamespace}}', $this->laravel->getNamespace(), $stub
);

return $this;
Expand Down Expand Up @@ -194,7 +191,7 @@ protected function getViewPath()
*/
protected function makeViewName()
{
$name = str_replace($this->getAppNamespace(), '', $this->argument('name'));
$name = str_replace($this->laravel->getNamespace(), '', $this->argument('name'));
$name = str_replace('\\', '/', $name);

// convert to snake_case part by part to avoid unexpected underscores.
Expand Down
5 changes: 1 addition & 4 deletions src/Misc/LaravelApplicationWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@

use Arrilot\Widgets\Contracts\ApplicationWrapperContract;
use Closure;
use Illuminate\Console\AppNamespaceDetectorTrait;
use Illuminate\Container\Container;

class LaravelApplicationWrapper implements ApplicationWrapperContract
{
use AppNamespaceDetectorTrait;

/**
* Laravel application instance.
*/
Expand Down Expand Up @@ -71,7 +68,7 @@ public function config($key, $default = null)
*/
public function getNamespace()
{
return $this->getAppNamespace();
return $this->app->getNamespace();
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
use Arrilot\Widgets\Factories\AsyncWidgetFactory;
use Arrilot\Widgets\Factories\WidgetFactory;
use Arrilot\Widgets\Misc\LaravelApplicationWrapper;
use Illuminate\Console\AppNamespaceDetectorTrait;
use Illuminate\Support\Facades\Blade;

class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
use AppNamespaceDetectorTrait;

/**
* Register the service provider.
*
Expand Down

0 comments on commit b115c03

Please sign in to comment.