Skip to content

Commit 969b16a

Browse files
DaneEverittStyleCIBot
authored andcommitted
Apply fixes from StyleCI
[ci skip] [skip ci]
1 parent 3078b61 commit 969b16a

File tree

9 files changed

+29
-38
lines changed

9 files changed

+29
-38
lines changed

app/Contracts/Repository/RepositoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function insert(array $data): bool;
202202
public function insertIgnore(array $values): bool;
203203

204204
/**
205-
* Get the amount of entries in the database
205+
* Get the amount of entries in the database.
206206
*
207207
* @return int
208208
*/

app/Contracts/Repository/ServerRepositoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function getServersForPowerActionCount(array $servers = [], array $nodes
147147
public function isUniqueUuidCombo(string $uuid, string $short): bool;
148148

149149
/**
150-
* Get the amount of servers that are suspended
150+
* Get the amount of servers that are suspended.
151151
*
152152
* @return int
153153
*/

app/Http/Controllers/Admin/StatisticsController.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22

33
namespace Pterodactyl\Http\Controllers\Admin;
44

5-
use Illuminate\Http\Request;
6-
use Illuminate\Support\Facades\DB;
7-
use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface;
8-
use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface;
5+
use Pterodactyl\Http\Controllers\Controller;
96
use Pterodactyl\Contracts\Repository\EggRepositoryInterface;
7+
use Pterodactyl\Traits\Controllers\PlainJavascriptInjection;
108
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
11-
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
129
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
13-
use Pterodactyl\Http\Controllers\Controller;
14-
use Pterodactyl\Traits\Controllers\PlainJavascriptInjection;
10+
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
11+
use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface;
12+
use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface;
1513

1614
class StatisticsController extends Controller
1715
{
@@ -29,15 +27,14 @@ class StatisticsController extends Controller
2927

3028
private $userRepository;
3129

32-
function __construct(
30+
public function __construct(
3331
AllocationRepositoryInterface $allocationRepository,
3432
DatabaseRepositoryInterface $databaseRepository,
3533
EggRepositoryInterface $eggRepository,
3634
NodeRepositoryInterface $nodeRepository,
3735
ServerRepositoryInterface $serverRepository,
3836
UserRepositoryInterface $userRepository
39-
)
40-
{
37+
) {
4138
$this->allocationRepository = $allocationRepository;
4239
$this->databaseRepository = $databaseRepository;
4340
$this->eggRepository = $eggRepository;
@@ -83,7 +80,7 @@ public function index()
8380
'nodes' => $nodes,
8481
'tokens' => $tokens,
8582
]);
86-
83+
8784
return view('admin.statistics', [
8885
'servers' => $servers,
8986
'nodes' => $nodes,
@@ -97,5 +94,4 @@ public function index()
9794
'totalAllocations' => $totalAllocations,
9895
]);
9996
}
100-
10197
}

app/Http/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Pterodactyl\Http;
44

5-
use Pterodactyl\Http\Middleware\MaintenanceMiddleware;
65
use Pterodactyl\Models\ApiKey;
76
use Illuminate\Auth\Middleware\Authorize;
87
use Illuminate\Auth\Middleware\Authenticate;
@@ -21,6 +20,7 @@
2120
use Pterodactyl\Http\Middleware\AccessingValidServer;
2221
use Pterodactyl\Http\Middleware\Api\SetSessionDriver;
2322
use Illuminate\View\Middleware\ShareErrorsFromSession;
23+
use Pterodactyl\Http\Middleware\MaintenanceMiddleware;
2424
use Pterodactyl\Http\Middleware\RedirectIfAuthenticated;
2525
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
2626
use Pterodactyl\Http\Middleware\Api\AuthenticateIPAccess;

app/Repositories/Eloquent/EloquentRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public function insertIgnore(array $values): bool
298298
}
299299

300300
/**
301-
* Get the amount of entries in the database
301+
* Get the amount of entries in the database.
302302
*
303303
* @return int
304304
*/

app/Repositories/Eloquent/ServerRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ private function getUserAccessServers(int $user): array
330330
}
331331

332332
/**
333-
* Get the amount of servers that are suspended
333+
* Get the amount of servers that are suspended.
334334
*
335335
* @return int
336336
*/

app/Traits/Controllers/PlainJavascriptInjection.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Created by PhpStorm.
44
* User: Stan
55
* Date: 26-5-2018
6-
* Time: 20:56
6+
* Time: 20:56.
77
*/
88

99
namespace Pterodactyl\Traits\Controllers;
@@ -12,13 +12,11 @@
1212

1313
trait PlainJavascriptInjection
1414
{
15-
1615
/**
17-
* Injects statistics into javascript
16+
* Injects statistics into javascript.
1817
*/
1918
public function injectJavascript($data)
2019
{
2120
Javascript::put($data);
2221
}
23-
24-
}
22+
}

database/migrations/2018_05_04_123826_add_maintenance_to_nodes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AddMaintenanceToNodes extends Migration
1414
public function up()
1515
{
1616
Schema::table('nodes', function (Blueprint $table) {
17-
$table->boolean('maintenance_mode')->after('behind_proxy')->default(false);
17+
$table->boolean('maintenance_mode')->after('behind_proxy')->default(false);
1818
});
1919
}
2020

@@ -26,7 +26,7 @@ public function up()
2626
public function down()
2727
{
2828
Schema::table('nodes', function (Blueprint $table) {
29-
$table->dropColumn('maintenance_mode');
29+
$table->dropColumn('maintenance_mode');
3030
});
3131
}
3232
}

tests/Unit/Http/Controllers/Admin/StatisticsControllerTest.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,22 @@
33
* Created by PhpStorm.
44
* User: Stan
55
* Date: 26-5-2018
6-
* Time: 21:06
6+
* Time: 21:06.
77
*/
88

99
namespace Tests\Unit\Http\Controllers\Admin;
1010

11-
use Illuminate\Database\Eloquent\Builder;
12-
use Illuminate\Routing\Controller;
1311
use Mockery as m;
14-
use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface;
15-
use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface;
16-
use Pterodactyl\Contracts\Repository\EggRepositoryInterface;
17-
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
18-
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
19-
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
20-
use Pterodactyl\Http\Controllers\Admin\StatisticsController;
2112
use Pterodactyl\Models\Node;
2213
use Tests\Assertions\ControllerAssertionsTrait;
2314
use Tests\Unit\Http\Controllers\ControllerTestCase;
15+
use Pterodactyl\Contracts\Repository\EggRepositoryInterface;
16+
use Pterodactyl\Http\Controllers\Admin\StatisticsController;
17+
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
18+
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
19+
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
20+
use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface;
21+
use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface;
2422

2523
class StatisticsControllerTest extends ControllerTestCase
2624
{
@@ -88,7 +86,7 @@ public function testIndexController()
8886
'disk' => [
8987
'value' => 1024,
9088
'max' => 512,
91-
]
89+
],
9290
]);
9391

9492
$controller->shouldReceive('injectJavascript')->once();
@@ -106,8 +104,7 @@ private function getController()
106104
$this->eggRepository,
107105
$this->nodeRepository,
108106
$this->serverRepository,
109-
$this->userRepository]
107+
$this->userRepository, ]
110108
);
111109
}
112-
113-
}
110+
}

0 commit comments

Comments
 (0)