Skip to content

Commit

Permalink
Merge pull request #27 from ARCANEDEV/update-laravel_6.0_support
Browse files Browse the repository at this point in the history
Adding Laravel 6.0 Support
  • Loading branch information
arcanedev-maroc authored Sep 4, 2019
2 parents 2bb6e90 + 247f571 commit cb32ca2
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 3
runs: 2
php_code_sniffer:
enabled: true
config:
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ language: php
sudo: false

php:
- 7.1.3
- 7.1
- 7.2
- 7.3
- nightly

matrix:
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"type": "library",
"license": "MIT",
"require": {
"php": ">=7.1.3",
"illuminate/filesystem": "~5.8.0",
"illuminate/support": "~5.8.0"
"php": ">=7.2.0",
"illuminate/filesystem": "~6.0.0",
"illuminate/support": "~6.0.0"
},
"require-dev": {
"orchestra/testbench": "~3.8.0",
"phpunit/phpcov": "~5.0|~6.0",
"phpunit/phpunit": "~7.0|~8.0"
"orchestra/testbench": "~4.0.0",
"phpunit/phpcov": "~6.0",
"phpunit/phpunit": "~8.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 2 additions & 1 deletion src/Bases/Policy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Arcanedev\Support\Exceptions\MissingPolicyException;
use Illuminate\Support\Str;
use ReflectionClass;

/**
* Class Policy
Expand All @@ -24,7 +25,7 @@ abstract class Policy
public static function policies()
{
$abilities = array_values(
(new \ReflectionClass($instance = new static))->getConstants()
(new ReflectionClass($instance = new static))->getConstants()
);

return array_map(function ($constant) use ($instance) {
Expand Down
4 changes: 3 additions & 1 deletion src/Exceptions/MissingPolicyException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php namespace Arcanedev\Support\Exceptions;

use Exception;

/**
* Class MissingPolicyException
*
* @package Arcanedev\Support\Exceptions
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class MissingPolicyException extends \Exception {}
class MissingPolicyException extends Exception {}
4 changes: 3 additions & 1 deletion src/Exceptions/PackageException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php namespace Arcanedev\Support\Exceptions;

use Exception;

/**
* Class PackageException
*
* @package Arcanedev\Support\Exceptions
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class PackageException extends \Exception {}
class PackageException extends Exception {}
4 changes: 3 additions & 1 deletion src/Exceptions/RouteNamespaceUndefinedException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php namespace Arcanedev\Support\Exceptions;

use Exception;

/**
* Class RouteNamespaceUndefinedException
*
* @package Arcanedev\Support\Exceptions
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class RouteNamespaceUndefinedException extends \Exception {}
class RouteNamespaceUndefinedException extends Exception {}
8 changes: 0 additions & 8 deletions src/Http/Controller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace Arcanedev\Support\Http;

use Arcanedev\Support\Traits\Abortable;
use Illuminate\Routing\Controller as IlluminateController;

/**
Expand All @@ -11,13 +10,6 @@
*/
abstract class Controller extends IlluminateController
{
/* -----------------------------------------------------------------
| Traits
| -----------------------------------------------------------------
*/

use Abortable;

/* -----------------------------------------------------------------
| Properties
| -----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/AuthorizationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @package Arcanedev\Support\Providers
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class AuthorizationServiceProvider extends AuthServiceProvider
abstract class AuthorizationServiceProvider extends AuthServiceProvider
{
/* -----------------------------------------------------------------
| Main Methods
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/ViewComposerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @package Arcanedev\Support\Providers
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class ViewComposerServiceProvider extends ServiceProvider
abstract class ViewComposerServiceProvider extends ServiceProvider
{
/* -----------------------------------------------------------------
| Properties
Expand Down
10 changes: 4 additions & 6 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,13 @@ protected function singleton($abstract, $concrete = null)
* Register a service provider.
*
* @param \Illuminate\Support\ServiceProvider|string $provider
* @param array $options
* @param bool $force
*
* @return \Illuminate\Support\ServiceProvider
*/
protected function registerProvider($provider, array $options = [], $force = false)
protected function registerProvider($provider, $force = false)
{
return $this->app->register($provider, $options, $force);
return $this->app->register($provider, $force);
}

/**
Expand All @@ -129,15 +128,14 @@ protected function registerProviders(array $providers)
* Register a console service provider.
*
* @param \Illuminate\Support\ServiceProvider|string $provider
* @param array $options
* @param bool $force
*
* @return \Illuminate\Support\ServiceProvider|null
*/
protected function registerConsoleServiceProvider($provider, array $options = [], $force = false)
protected function registerConsoleServiceProvider($provider, $force = false)
{
if ($this->app->runningInConsole())
return $this->registerProvider($provider, $options, $force);
return $this->registerProvider($provider, $force);

return null;
}
Expand Down
39 changes: 0 additions & 39 deletions src/Traits/Abortable.php

This file was deleted.

5 changes: 3 additions & 2 deletions tests/StubTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace Arcanedev\Support\Tests;

use Arcanedev\Support\Stub;
use Illuminate\Support\Str;

/**
* Class StubTest
Expand Down Expand Up @@ -71,8 +72,8 @@ public function it_can_create()
'PACKAGE' => 'package',
'AUTHOR_NAME' => 'ARCANEDEV',
'AUTHOR_EMAIL' => 'arcanedev.maroc@gmail.com',
'MODULE_NAMESPACE' => studly_case('arcanedev'),
'STUDLY_NAME' => studly_case('package'),
'MODULE_NAMESPACE' => Str::studly('arcanedev'),
'STUDLY_NAME' => Str::studly('package'),
]);

$this->stub->save('composer.json');
Expand Down
6 changes: 2 additions & 4 deletions tests/Stubs/DummyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ public function index()
return 'Dummy';
}

public function getOne($slug)
public function show($slug)
{
if ($slug !== 'super') {
return $this->pageNotFound('Super dummy not found !');
}
abort_unless($slug === 'super', 404, 'Super dummy not found !');

return 'Super dummy';
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private function registerRoutes($app)

$router->get('{slug}', [
'as' => 'dummy::get',
'uses' => 'DummyController@getOne'
'uses' => 'DummyController@show'
]);
});

Expand Down

0 comments on commit cb32ca2

Please sign in to comment.