Update dependencies to latest versions

This commit is contained in:
Dane Everitt 2020-06-23 21:24:37 -07:00
parent ba0c78d2ab
commit c3aa257a2b
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 1742 additions and 799 deletions

View file

@ -3,6 +3,7 @@
namespace Pterodactyl\Exceptions; namespace Pterodactyl\Exceptions;
use Exception; use Exception;
use Throwable;
use PDOException; use PDOException;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Swift_TransportException; use Swift_TransportException;
@ -72,12 +73,12 @@ class Handler extends ExceptionHandler
* services such as AWS Cloudwatch or other monitoring you can replace the * services such as AWS Cloudwatch or other monitoring you can replace the
* contents of this function with a call to the parent reporter. * contents of this function with a call to the parent reporter.
* *
* @param \Exception $exception * @param \Throwable $exception
* @return mixed * @return mixed
* *
* @throws \Exception * @throws \Throwable
*/ */
public function report(Exception $exception) public function report(Throwable $exception)
{ {
if (! config('app.exceptions.report_all', false) && $this->shouldntReport($exception)) { if (! config('app.exceptions.report_all', false) && $this->shouldntReport($exception)) {
return null; return null;
@ -103,7 +104,7 @@ class Handler extends ExceptionHandler
return $logger->error($exception); return $logger->error($exception);
} }
private function generateCleanedExceptionStack(Exception $exception) private function generateCleanedExceptionStack(Throwable $exception)
{ {
$cleanedStack = ''; $cleanedStack = '';
foreach ($exception->getTrace() as $index => $item) { foreach ($exception->getTrace() as $index => $item) {
@ -133,12 +134,12 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Exception $exception * @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
* *
* @throws \Exception * @throws \Throwable
*/ */
public function render($request, Exception $exception) public function render($request, Throwable $exception)
{ {
$connections = Container::getInstance()->make(Connection::class); $connections = Container::getInstance()->make(Connection::class);
@ -200,11 +201,11 @@ class Handler extends ExceptionHandler
/** /**
* Return the exception as a JSONAPI representation for use on API requests. * Return the exception as a JSONAPI representation for use on API requests.
* *
* @param \Exception $exception * @param \Throwable $exception
* @param array $override * @param array $override
* @return array * @return array
*/ */
public static function convertToArray(Exception $exception, array $override = []): array public static function convertToArray(Throwable $exception, array $override = []): array
{ {
$error = [ $error = [
'code' => class_basename($exception), 'code' => class_basename($exception),
@ -259,10 +260,10 @@ class Handler extends ExceptionHandler
* Converts an exception into an array to render in the response. Overrides * Converts an exception into an array to render in the response. Overrides
* Laravel's built-in converter to output as a JSONAPI spec compliant object. * Laravel's built-in converter to output as a JSONAPI spec compliant object.
* *
* @param \Exception $exception * @param \Throwable $exception
* @return array * @return array
*/ */
protected function convertExceptionToArray(Exception $exception) protected function convertExceptionToArray(Throwable $exception)
{ {
return self::convertToArray($exception); return self::convertToArray($exception);
} }

View file

@ -11,7 +11,7 @@
} }
], ],
"require": { "require": {
"php": ">=7.2", "php": "^7.2",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-pdo_mysql": "*", "ext-pdo_mysql": "*",
"ext-zip": "*", "ext-zip": "*",
@ -23,9 +23,10 @@
"guzzlehttp/guzzle": "^6.5", "guzzlehttp/guzzle": "^6.5",
"hashids/hashids": "^4.0", "hashids/hashids": "^4.0",
"laracasts/utilities": "^3.1", "laracasts/utilities": "^3.1",
"laravel/framework": "^6.18", "laravel/framework": "^7.17",
"laravel/helpers": "^1.2", "laravel/helpers": "^1.2",
"laravel/tinker": "^1.0", "laravel/tinker": "^2.4",
"laravel/ui": "^2.0",
"lcobucci/jwt": "^3.3", "lcobucci/jwt": "^3.3",
"league/flysystem-aws-s3-v3": "^1.0", "league/flysystem-aws-s3-v3": "^1.0",
"league/flysystem-memory": "^1.0", "league/flysystem-memory": "^1.0",
@ -33,20 +34,21 @@
"pragmarx/google2fa": "^5.0", "pragmarx/google2fa": "^5.0",
"predis/predis": "^1.1", "predis/predis": "^1.1",
"prologue/alerts": "^0.4", "prologue/alerts": "^0.4",
"psy/psysh": "^0.10.4",
"s1lentium/iptools": "^1.1", "s1lentium/iptools": "^1.1",
"spatie/laravel-fractal": "^5.7", "spatie/laravel-fractal": "^5.7",
"staudenmeir/belongs-to-through": "^2.9", "staudenmeir/belongs-to-through": "^2.10",
"symfony/yaml": "^4.4", "symfony/yaml": "^4.4",
"webmozart/assert": "^1.7" "webmozart/assert": "^1.9"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.2", "barryvdh/laravel-debugbar": "^3.3",
"barryvdh/laravel-ide-helper": "^2.6", "barryvdh/laravel-ide-helper": "^2.7",
"codedungeon/phpunit-result-printer": "0.25.1", "codedungeon/phpunit-result-printer": "0.25.1",
"friendsofphp/php-cs-fixer": "^2.16.1", "friendsofphp/php-cs-fixer": "2.16.1",
"laravel/dusk": "^5.11", "laravel/dusk": "^6.3",
"php-mock/php-mock-phpunit": "^2.6", "php-mock/php-mock-phpunit": "^2.6",
"phpunit/phpunit": "^7" "phpunit/phpunit": "^8.5"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [

2483
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -8,19 +8,19 @@ use GuzzleHttp\Psr7\Response;
use Pterodactyl\Models\Server; use Pterodactyl\Models\Server;
use Illuminate\Validation\Factory; use Illuminate\Validation\Factory;
use Tests\Unit\Commands\CommandTestCase; use Tests\Unit\Commands\CommandTestCase;
use Pterodactyl\Repositories\Wings\DaemonPowerRepository;
use Pterodactyl\Console\Commands\Server\BulkPowerActionCommand; use Pterodactyl\Console\Commands\Server\BulkPowerActionCommand;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface;
class BulkPowerActionCommandTest extends CommandTestCase class BulkPowerActionCommandTest extends CommandTestCase
{ {
/** /**
* @var \Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface|\Mockery\Mock * @var \Mockery\MockInterface
*/ */
private $powerRepository; private $powerRepository;
/** /**
* @var \Pterodactyl\Contracts\Repository\ServerRepositoryInterface|\Mockery\Mock * @var \Mockery\MockInterface
*/ */
private $repository; private $repository;
@ -31,7 +31,7 @@ class BulkPowerActionCommandTest extends CommandTestCase
{ {
parent::setUp(); parent::setUp();
$this->powerRepository = m::mock(PowerRepositoryInterface::class); $this->powerRepository = m::mock(DaemonPowerRepository::class);
$this->repository = m::mock(ServerRepositoryInterface::class); $this->repository = m::mock(ServerRepositoryInterface::class);
} }
@ -47,10 +47,7 @@ class BulkPowerActionCommandTest extends CommandTestCase
$server->setRelation('node', factory(Node::class)->make()); $server->setRelation('node', factory(Node::class)->make());
} }
$this->repository->shouldReceive('getServersForPowerActionCount') $this->repository->expects('getServersForPowerActionCount')->with([], [])->andReturns(2);
->once()
->with([], [])
->andReturn(2);
$this->repository->shouldReceive('getServersForPowerAction') $this->repository->shouldReceive('getServersForPowerAction')
->once() ->once()