Format files

This commit is contained in:
Dane Everitt 2019-09-05 21:32:57 -07:00
parent 26e4ff1f62
commit 7543ef085d
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
193 changed files with 624 additions and 602 deletions

View file

@ -39,7 +39,7 @@ return PhpCsFixer\Config::create()
'ordered_imports' => [ 'ordered_imports' => [
'sortAlgorithm' => 'length', 'sortAlgorithm' => 'length',
], ],
'phpdoc_align' => ['tags' => ['param']], 'phpdoc_align' => false,
'phpdoc_separation' => false, 'phpdoc_separation' => false,
'protected_to_private' => false, 'protected_to_private' => false,
'psr0' => ['dir' => 'app'], 'psr0' => ['dir' => 'app'],

View file

@ -59,6 +59,7 @@ class EmailSettingsCommand extends Command
/** /**
* Handle command execution. * Handle command execution.
*
* @throws \Pterodactyl\Exceptions\PterodactylException * @throws \Pterodactyl\Exceptions\PterodactylException
*/ */
public function handle() public function handle()

View file

@ -9,6 +9,8 @@
namespace Pterodactyl\Exceptions; namespace Pterodactyl\Exceptions;
class AccountNotFoundException extends \Exception use Exception;
class AccountNotFoundException extends Exception
{ {
} }

View file

@ -9,6 +9,8 @@
namespace Pterodactyl\Exceptions; namespace Pterodactyl\Exceptions;
class AutoDeploymentException extends \Exception use Exception;
class AutoDeploymentException extends Exception
{ {
} }

View file

@ -2,6 +2,8 @@
namespace Pterodactyl\Exceptions; namespace Pterodactyl\Exceptions;
class PterodactylException extends \Exception use Exception;
class PterodactylException extends Exception
{ {
} }

View file

@ -9,6 +9,8 @@
namespace Pterodactyl\Exceptions\Service\Helper; namespace Pterodactyl\Exceptions\Service\Helper;
class CdnVersionFetchingException extends \Exception use Exception;
class CdnVersionFetchingException extends Exception
{ {
} }

View file

@ -9,6 +9,8 @@
namespace Pterodactyl\Exceptions\Service\Pack; namespace Pterodactyl\Exceptions\Service\Pack;
class ZipArchiveCreationException extends \Exception use Exception;
class ZipArchiveCreationException extends Exception
{ {
} }

View file

@ -9,6 +9,8 @@
namespace Pterodactyl\Exceptions\Service\User; namespace Pterodactyl\Exceptions\Service\User;
class TwoFactorAuthenticationTokenInvalid extends \Exception use Exception;
class TwoFactorAuthenticationTokenInvalid extends Exception
{ {
} }

View file

@ -25,10 +25,15 @@ use Pterodactyl\Contracts\Repository\NestRepositoryInterface;
class EggController extends Controller class EggController extends Controller
{ {
protected $alert; protected $alert;
protected $creationService; protected $creationService;
protected $deletionService; protected $deletionService;
protected $nestRepository; protected $nestRepository;
protected $repository; protected $repository;
protected $updateService; protected $updateService;
public function __construct( public function __construct(

View file

@ -6,7 +6,6 @@ use Cache;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Pterodactyl\Models\Node; use Pterodactyl\Models\Node;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Pterodactyl\Models\Server;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Repositories\Eloquent\ServerRepository; use Pterodactyl\Repositories\Eloquent\ServerRepository;
@ -20,6 +19,7 @@ class ActionController extends Controller
* @var \Illuminate\Contracts\Events\Dispatcher * @var \Illuminate\Contracts\Events\Dispatcher
*/ */
private $eventDispatcher; private $eventDispatcher;
/** /**
* @var \Pterodactyl\Repositories\Eloquent\ServerRepository * @var \Pterodactyl\Repositories\Eloquent\ServerRepository
*/ */

View file

@ -47,6 +47,7 @@ class GetExternalUserRequest extends ApplicationApiRequest
/** /**
* Return the user model for the requested external user. * Return the user model for the requested external user.
*
* @return \Pterodactyl\Models\User * @return \Pterodactyl\Models\User
*/ */
public function getUserModel(): User public function getUserModel(): User

View file

@ -2,12 +2,13 @@
namespace Pterodactyl\Http\Requests\Api\Client; namespace Pterodactyl\Http\Requests\Api\Client;
use Pterodactyl\Models\User;
use Pterodactyl\Models\Server; use Pterodactyl\Models\Server;
use Pterodactyl\Contracts\Http\ClientPermissionsRequest; use Pterodactyl\Contracts\Http\ClientPermissionsRequest;
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest; use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
/** /**
* @method \Pterodactyl\Models\User user($guard = null) * @method User user($guard = null)
*/ */
abstract class ClientApiRequest extends ApplicationApiRequest abstract class ClientApiRequest extends ApplicationApiRequest
{ {

View file

@ -9,6 +9,7 @@
namespace Pterodactyl\Http\Requests\Base; namespace Pterodactyl\Http\Requests\Base;
use Exception;
use IPTools\Network; use IPTools\Network;
use Pterodactyl\Http\Requests\FrontendUserFormRequest; use Pterodactyl\Http\Requests\FrontendUserFormRequest;
@ -65,7 +66,7 @@ class ApiKeyFormRequest extends FrontendUserFormRequest
try { try {
Network::parse($ip); Network::parse($ip);
} catch (\Exception $ex) { } catch (Exception $ex) {
$validator->errors()->add('allowed_ips', 'Could not parse IP ' . $ip . ' because it is in an invalid format.'); $validator->errors()->add('allowed_ips', 'Could not parse IP ' . $ip . ' because it is in an invalid format.');
} }
} }

View file

@ -2,7 +2,6 @@
namespace Pterodactyl\Repositories\Eloquent; namespace Pterodactyl\Repositories\Eloquent;
use Pterodactyl\Models\Node;
use Pterodactyl\Models\User; use Pterodactyl\Models\User;
use Webmozart\Assert\Assert; use Webmozart\Assert\Assert;
use Pterodactyl\Models\Server; use Pterodactyl\Models\Server;

View file

@ -2,6 +2,7 @@
namespace Pterodactyl\Services\Databases; namespace Pterodactyl\Services\Databases;
use Exception;
use Pterodactyl\Models\Database; use Pterodactyl\Models\Database;
use Illuminate\Database\DatabaseManager; use Illuminate\Database\DatabaseManager;
use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Contracts\Encryption\Encrypter;
@ -90,14 +91,14 @@ class DatabaseManagementService
$this->repository->flush(); $this->repository->flush();
$this->database->commit(); $this->database->commit();
} catch (\Exception $ex) { } catch (Exception $ex) {
try { try {
if (isset($database) && $database instanceof Database) { if (isset($database) && $database instanceof Database) {
$this->repository->dropDatabase($database->database); $this->repository->dropDatabase($database->database);
$this->repository->dropUser($database->username, $database->remote); $this->repository->dropUser($database->username, $database->remote);
$this->repository->flush(); $this->repository->flush();
} }
} catch (\Exception $exTwo) { } catch (Exception $exTwo) {
// ignore an exception // ignore an exception
} }

View file

@ -61,7 +61,7 @@ class PackDeletionService
/** /**
* Delete a pack from the database as well as the archive stored on the server. * Delete a pack from the database as well as the archive stored on the server.
* *
* @param int|\Pterodactyl\Models\Pack$pack * @param int|\Pterodactyl\Models\Pack $pack
* *
* @throws \Pterodactyl\Exceptions\Service\HasActiveServersException * @throws \Pterodactyl\Exceptions\Service\HasActiveServersException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException

View file

@ -9,6 +9,7 @@
namespace Pterodactyl\Services\Servers; namespace Pterodactyl\Services\Servers;
use InvalidArgumentException;
use Pterodactyl\Models\Server; use Pterodactyl\Models\Server;
use Psr\Log\LoggerInterface as Writer; use Psr\Log\LoggerInterface as Writer;
use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Exception\RequestException;
@ -80,7 +81,7 @@ class SuspensionService
} }
if (! in_array($action, [self::ACTION_SUSPEND, self::ACTION_UNSUSPEND])) { if (! in_array($action, [self::ACTION_SUSPEND, self::ACTION_UNSUSPEND])) {
throw new \InvalidArgumentException(sprintf( throw new InvalidArgumentException(sprintf(
'Action must be either ' . self::ACTION_SUSPEND . ' or ' . self::ACTION_UNSUSPEND . ', %s passed.', 'Action must be either ' . self::ACTION_SUSPEND . ' or ' . self::ACTION_UNSUSPEND . ', %s passed.',
$action $action
)); ));