Apply fixes from StyleCI (#294)

This commit is contained in:
Dane Everitt 2017-02-12 15:10:39 -05:00 committed by GitHub
parent a10e235beb
commit 7c916ad38f
21 changed files with 21 additions and 40 deletions

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Http\Controllers\API;
use DB;
use Illuminate\Http\Request;
use Pterodactyl\Models\Location;

View File

@ -138,7 +138,7 @@ class NodeController extends BaseController
$node->allocations->transform(function ($item) {
return collect($item)->only([
'id', 'ip', 'ip_alias', 'port', 'server_id'
'id', 'ip', 'ip_alias', 'port', 'server_id',
]);
});

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Http\Controllers\API\User;
use Pterodactyl\Models;
use Illuminate\Http\Request;
use Pterodactyl\Http\Controllers\API\BaseController;

View File

@ -31,7 +31,6 @@ use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Repositories\UserRepository;
use Pterodactyl\Exceptions\DisplayValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
/**

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Http\Controllers\Admin;
use DB;
use Log;
use Alert;
use Pterodactyl\Models;

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Http\Controllers\Admin;
use DB;
use Alert;
use Pterodactyl\Models;
use Illuminate\Http\Request;

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Http\Controllers\Admin;
use DB;
use Log;
use Alert;
use Storage;
@ -50,7 +49,7 @@ class PackController extends Controller
public function listByOption(Request $request, $id)
{
return view('admin.services.packs.byoption', [
'option' => Models\ServiceOptions::with('service', 'packs')->findOrFail($id)
'option' => Models\ServiceOptions::with('service', 'packs')->findOrFail($id),
]);
}

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Http\Controllers\Admin;
use DB;
use Log;
use Alert;
use Pterodactyl\Models;
@ -62,7 +61,6 @@ class ServersController extends Controller
public function getView(Request $request, $id)
{
$server = Models\Server::withTrashed()->with(
'user', 'option.variables', 'variables',
'node.allocations', 'databases.host'

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Http\Controllers\Admin;
use DB;
use Log;
use Alert;
use Storage;

View File

@ -29,7 +29,6 @@ use Log;
use Alert;
use Illuminate\Http\Request;
use Pterodactyl\Models\User;
use Pterodactyl\Models\Server;
use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Repositories\UserRepository;

View File

@ -26,7 +26,6 @@
namespace Pterodactyl\Http\Controllers\Base;
use Illuminate\Http\Request;
use Pterodactyl\Models\Server;
use Pterodactyl\Http\Controllers\Controller;
class IndexController extends Controller

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Http\Controllers\Server;
use DB;
use Log;
use Auth;
use Alert;

View File

@ -68,10 +68,10 @@ class Allocation extends Model
* Accessor to quickly determine if this allocation has an alias.
*
* @param null|string $value
* @return boolean
* @return bool
*/
public function getHasAliasAttribute($value)
{
return (! is_null($this->ip_alias));
return ! is_null($this->ip_alias);
}
}

View File

@ -28,11 +28,10 @@ use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
/**
* Should timestamps be used on this model.
*
* @var boolean
* @var bool
*/
public $timestamps = false;

View File

@ -54,8 +54,8 @@ class ServiceVariables extends Model
'required' => 'integer',
];
public function serverVariables()
{
return $this->hasMany(ServerVariables::class, 'variable_id');
}
public function serverVariables()
{
return $this->hasMany(ServerVariables::class, 'variable_id');
}
}

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Models;
use Auth;
use Illuminate\Database\Eloquent\Model;
class Subuser extends Model
@ -50,11 +49,11 @@ class Subuser extends Model
*/
protected $guarded = ['id', 'created_at', 'updated_at'];
/**
* Cast values to correct type.
*
* @var array
*/
/**
* Cast values to correct type.
*
* @var array
*/
protected $casts = [
'user_id' => 'integer',
'server_id' => 'integer',

View File

@ -177,8 +177,6 @@ class Pack
'selectable' => isset($data['selectable']),
'visible' => isset($data['visible']),
]);
return;
}
public function delete($id)

View File

@ -80,7 +80,7 @@ class Variable
DB::beginTransaction();
try {
foreach($variable->serverVariables as $svar) {
foreach ($variable->serverVariables as $svar) {
$svar->delete();
}
$variable->delete();

View File

@ -25,8 +25,6 @@
namespace Pterodactyl\Repositories;
use DB;
use Mail;
use Settings;
use Validator;
use Pterodactyl\Models;
use Pterodactyl\Services\UuidService;
@ -229,7 +227,7 @@ class SubuserRepository
],
]);
foreach($subuser->permissions as &$permission) {
foreach ($subuser->permissions as &$permission) {
$permission->delete();
}
$subuser->delete();
@ -273,7 +271,7 @@ class SubuserRepository
DB::beginTransaction();
try {
foreach($subuser->permissions as &$permission) {
foreach ($subuser->permissions as &$permission) {
$permission->delete();
}

View File

@ -24,7 +24,6 @@
namespace Pterodactyl\Services;
use Pterodactyl\Models\User;
use Pterodactyl\Models\Server;
use Pterodactyl\Notifications\Daemon;

View File

@ -1,10 +1,10 @@
<?php
use Pterodactyl\Models\Subuser;
use Pterodactyl\Models\Permission;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Pterodactyl\Models\Subuser;
use Pterodactyl\Models\Permission;
class SetupPermissionsPivotTable extends Migration
{
@ -20,7 +20,7 @@ class SetupPermissionsPivotTable extends Migration
});
DB::transaction(function () {
foreach(Subuser::all() as &$subuser) {
foreach (Subuser::all() as &$subuser) {
Permission::where('user_id', $subuser->user_id)->where('server_id', $subuser->server_id)->update([
'subuser_id' => $subuser->id,
]);
@ -55,7 +55,7 @@ class SetupPermissionsPivotTable extends Migration
});
DB::transaction(function () {
foreach(Subuser::all() as &$subuser) {
foreach (Subuser::all() as &$subuser) {
Permission::where('subuser_id', $subuser->id)->update([
'user_id' => $subuser->user_id,
'server_id' => $subuser->server_id,