Skip to content

Commit

Permalink
Laravel 7 support (#29)
Browse files Browse the repository at this point in the history
* Initial package updates for laravel 7

* Remove past laravel versions for v2
Remove stubs package

* Laravel 7 compat

* exception updates in testing fixtures
  • Loading branch information
specialtactics authored May 10, 2020
1 parent e912b36 commit d3f54b6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ language: php
matrix:
fast_finish: true
include:
- php: 7.2
env: LARAVEL_VERSION=5.8.*
- php: 7.2
env: LARAVEL_VERSION=6.0.*
- php: 7.3
env: LARAVEL_VERSION=5.8.*
- php: 7.3
env: LARAVEL_VERSION=6.0.*
env: LARAVEL_VERSION=7.*
- php: 7.4
env: LARAVEL_VERSION=7.*

sudo: false

Expand Down
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@
}
],
"require": {
"php": "^7.2",
"dingo/api": "^2.4",
"php": "^7.2.5",
"dingo/api": "^3.0.0",
"tymon/jwt-auth": "^1.0",
"illuminate/support": "^6 || ^5.8",
"illuminate/support": "^7.0",
"webpatser/laravel-uuid": "^3.0",
"ramsey/uuid": "^3.0",
"atehnix/laravel-stubs": "~6.0"
"ramsey/uuid": "^3.0"
},
"require-dev": {
"ext-json": "*",
"beyondcode/laravel-dump-server": "^1.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.5 || ^8.3",
"orchestra/testbench": "^4 || ^3",
"fideloper/proxy": "^4.0"
"nunomaduro/collision": "^4.2",
"phpunit/phpunit": "^8.5",
"orchestra/testbench": "^5",
"fideloper/proxy": "^4.2"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions src/Exceptions/RestfulApiExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Specialtactics\L5Api\Exceptions;

use Config;
use Exception;
use Throwable;
use Dingo\Api\Exception\Handler as ExceptionHandler;
use Specialtactics\L5Api\APIBoilerplate;
use Specialtactics\L5Api\Helpers;
Expand All @@ -23,10 +23,10 @@ class RestfulApiExceptionHandler extends ExceptionHandler
/**
* Override prepare replacements function to add extra functionality
*
* @param Exception $exception
* @param Throwable $exception
* @return array
*/
protected function prepareReplacements(Exception $exception)
protected function prepareReplacements(Throwable $exception)
{
// Run parent
$replacements = parent::prepareReplacements($exception);
Expand Down
14 changes: 7 additions & 7 deletions test/app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Exceptions;

use Exception;
use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
Expand All @@ -29,23 +29,23 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* @param \Exception $exception
* @param Throwable $e
* @return void
*/
public function report(Exception $exception)
public function report(Throwable $e)
{
parent::report($exception);
parent::report($e);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param Throwable $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
public function render($request, Throwable $e)
{
return parent::render($request, $exception);
return parent::render($request, $e);
}
}

0 comments on commit d3f54b6

Please sign in to comment.