Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates as per Laravel 7 upgrade guide #1521

Merged
merged 3 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"composer/composer": "^1.7",
"facade/ignition-contracts": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.6.* || 5.7.* || 5.8.* || ^6.0",
"laravel/framework": "5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0",
"laravel/helpers": "^1.1",
"league/commonmark": "^1.3",
"league/csv": "^9.0",
Expand All @@ -32,7 +32,7 @@
"fzaninotto/faker": "~1.4",
"google/cloud-translate": "^1.6",
"mockery/mockery": "~1.0",
"nunomaduro/collision": "^3.0",
"nunomaduro/collision": "3.0 || ^4.1",
"orchestra/testbench": "3.8 || 4.0"
},
"config": {
Expand Down Expand Up @@ -68,4 +68,4 @@
"Foo\\Bar\\": "tests/fixtures/Addon"
}
}
}
}
10 changes: 5 additions & 5 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

namespace Statamic\Exceptions;

use Exception;
use Throwable;
use Statamic\Statamic;
use Illuminate\Support\Facades\View;
use App\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Illuminate\Auth\Access\AuthorizationException as IlluminateAuthException;

class Handler extends ExceptionHandler
{
public function render($request, Exception $e)
public function render($request, Throwable $e)
{
if ($e instanceof NotFoundHttpException && Statamic::isApiRoute()) {
return response()->json(['message' => $e->getMessage() ?: 'Not found.'], 404);
Expand All @@ -27,11 +27,11 @@ public function render($request, Exception $e)
/**
* Render an exception to a string using Symfony.
*
* @param \Exception $e
* @param Throwable $e
* @param bool $debug
* @return string
*/
protected function renderExceptionWithSymfony(Exception $e, $debug)
protected function renderExceptionWithSymfony(Throwable $e, $debug)
{
return (new SymfonyExceptionHandler($debug))->getHtml(
FlattenException::create($e)
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Resources/API/AssetResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Statamic\Http\Resources\API;

use Illuminate\Http\Resources\Json\Resource;
use Illuminate\Http\Resources\Json\JsonResource;

class AssetResource extends Resource
class AssetResource extends JsonResource
{
/**
* Transform the resource into an array.
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Resources/API/EntryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Statamic\Http\Resources\API;

use Illuminate\Http\Resources\Json\Resource;
use Illuminate\Http\Resources\Json\JsonResource;

class EntryResource extends Resource
class EntryResource extends JsonResource
{
/**
* Transform the resource into an array.
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Resources/API/GlobalSetResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Statamic\Http\Resources\API;

use Illuminate\Http\Resources\Json\Resource;
use Statamic\Statamic;
use Illuminate\Http\Resources\Json\JsonResource;

class GlobalSetResource extends Resource
class GlobalSetResource extends JsonResource
{
/**
* Transform the resource into an array.
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Resources/API/TermResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Statamic\Http\Resources\API;

use Illuminate\Http\Resources\Json\Resource;
use Illuminate\Http\Resources\Json\JsonResource;

class TermResource extends Resource
class TermResource extends JsonResource
{
/**
* Transform the resource into an array.
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Resources/API/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Statamic\Http\Resources\API;

use Illuminate\Http\Resources\Json\Resource;
use Statamic\Statamic;
use Illuminate\Http\Resources\Json\JsonResource;

class UserResource extends Resource
class UserResource extends JsonResource
{
/**
* Transform the resource into an array.
Expand Down
9 changes: 2 additions & 7 deletions src/Providers/ExtensionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@
use Statamic\Actions;
use Statamic\Fieldtypes;
use Statamic\Query\Scopes;
use Statamic\Extend\Manifest;
use Statamic\Modifiers\Modifier;
use Statamic\Extensions\FileStore;
use Statamic\Modifiers\CoreModifiers;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Cache;
use Statamic\Modifiers\CoreModifiers;
use Illuminate\Support\ServiceProvider;
use Statamic\Extend\Manifest;
use Illuminate\Console\DetectsApplicationNamespace;

class ExtensionServiceProvider extends ServiceProvider
{
use DetectsApplicationNamespace;
jasonvarga marked this conversation as resolved.
Show resolved Hide resolved

/**
* Aliases for modifiers bundled with Statamic.
*
Expand Down