Format files
This commit is contained in:
parent
26e4ff1f62
commit
7543ef085d
193 changed files with 624 additions and 602 deletions
2
.php_cs
2
.php_cs
|
@ -39,7 +39,7 @@ return PhpCsFixer\Config::create()
|
|||
'ordered_imports' => [
|
||||
'sortAlgorithm' => 'length',
|
||||
],
|
||||
'phpdoc_align' => ['tags' => ['param']],
|
||||
'phpdoc_align' => false,
|
||||
'phpdoc_separation' => false,
|
||||
'protected_to_private' => false,
|
||||
'psr0' => ['dir' => 'app'],
|
||||
|
|
|
@ -59,6 +59,7 @@ class EmailSettingsCommand extends Command
|
|||
|
||||
/**
|
||||
* Handle command execution.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\PterodactylException
|
||||
*/
|
||||
public function handle()
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Pterodactyl\Exceptions;
|
||||
|
||||
class AccountNotFoundException extends \Exception
|
||||
use Exception;
|
||||
|
||||
class AccountNotFoundException extends Exception
|
||||
{
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Pterodactyl\Exceptions;
|
||||
|
||||
class AutoDeploymentException extends \Exception
|
||||
use Exception;
|
||||
|
||||
class AutoDeploymentException extends Exception
|
||||
{
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Pterodactyl\Exceptions;
|
||||
|
||||
class PterodactylException extends \Exception
|
||||
use Exception;
|
||||
|
||||
class PterodactylException extends Exception
|
||||
{
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Pterodactyl\Exceptions\Service\Helper;
|
||||
|
||||
class CdnVersionFetchingException extends \Exception
|
||||
use Exception;
|
||||
|
||||
class CdnVersionFetchingException extends Exception
|
||||
{
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Pterodactyl\Exceptions\Service\Pack;
|
||||
|
||||
class ZipArchiveCreationException extends \Exception
|
||||
use Exception;
|
||||
|
||||
class ZipArchiveCreationException extends Exception
|
||||
{
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Pterodactyl\Exceptions\Service\User;
|
||||
|
||||
class TwoFactorAuthenticationTokenInvalid extends \Exception
|
||||
use Exception;
|
||||
|
||||
class TwoFactorAuthenticationTokenInvalid extends Exception
|
||||
{
|
||||
}
|
||||
|
|
|
@ -25,10 +25,15 @@ use Pterodactyl\Contracts\Repository\NestRepositoryInterface;
|
|||
class EggController extends Controller
|
||||
{
|
||||
protected $alert;
|
||||
|
||||
protected $creationService;
|
||||
|
||||
protected $deletionService;
|
||||
|
||||
protected $nestRepository;
|
||||
|
||||
protected $repository;
|
||||
|
||||
protected $updateService;
|
||||
|
||||
public function __construct(
|
||||
|
|
|
@ -6,7 +6,6 @@ use Cache;
|
|||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Models\Node;
|
||||
use Illuminate\Http\Response;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Pterodactyl\Repositories\Eloquent\ServerRepository;
|
||||
|
@ -20,6 +19,7 @@ class ActionController extends Controller
|
|||
* @var \Illuminate\Contracts\Events\Dispatcher
|
||||
*/
|
||||
private $eventDispatcher;
|
||||
|
||||
/**
|
||||
* @var \Pterodactyl\Repositories\Eloquent\ServerRepository
|
||||
*/
|
||||
|
|
|
@ -47,6 +47,7 @@ class GetExternalUserRequest extends ApplicationApiRequest
|
|||
|
||||
/**
|
||||
* Return the user model for the requested external user.
|
||||
*
|
||||
* @return \Pterodactyl\Models\User
|
||||
*/
|
||||
public function getUserModel(): User
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
|
||||
namespace Pterodactyl\Http\Requests\Api\Client;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Contracts\Http\ClientPermissionsRequest;
|
||||
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
||||
|
||||
/**
|
||||
* @method \Pterodactyl\Models\User user($guard = null)
|
||||
* @method User user($guard = null)
|
||||
*/
|
||||
abstract class ClientApiRequest extends ApplicationApiRequest
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
namespace Pterodactyl\Http\Requests\Base;
|
||||
|
||||
use Exception;
|
||||
use IPTools\Network;
|
||||
use Pterodactyl\Http\Requests\FrontendUserFormRequest;
|
||||
|
||||
|
@ -65,7 +66,7 @@ class ApiKeyFormRequest extends FrontendUserFormRequest
|
|||
|
||||
try {
|
||||
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.');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Repositories\Eloquent;
|
||||
|
||||
use Pterodactyl\Models\Node;
|
||||
use Pterodactyl\Models\User;
|
||||
use Webmozart\Assert\Assert;
|
||||
use Pterodactyl\Models\Server;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Pterodactyl\Services\Databases;
|
||||
|
||||
use Exception;
|
||||
use Pterodactyl\Models\Database;
|
||||
use Illuminate\Database\DatabaseManager;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
|
@ -90,14 +91,14 @@ class DatabaseManagementService
|
|||
$this->repository->flush();
|
||||
|
||||
$this->database->commit();
|
||||
} catch (\Exception $ex) {
|
||||
} catch (Exception $ex) {
|
||||
try {
|
||||
if (isset($database) && $database instanceof Database) {
|
||||
$this->repository->dropDatabase($database->database);
|
||||
$this->repository->dropUser($database->username, $database->remote);
|
||||
$this->repository->flush();
|
||||
}
|
||||
} catch (\Exception $exTwo) {
|
||||
} catch (Exception $exTwo) {
|
||||
// ignore an exception
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ class PackDeletionService
|
|||
/**
|
||||
* 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\Repository\RecordNotFoundException
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
namespace Pterodactyl\Services\Servers;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Psr\Log\LoggerInterface as Writer;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
|
@ -80,7 +81,7 @@ class SuspensionService
|
|||
}
|
||||
|
||||
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
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue