Updating PHPCS ruleset to match a better style guideline (blank lines for opening/closing braces)
ci/woodpecker/manual/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline failed
This commit is contained in:
@@ -16,13 +16,25 @@
|
|||||||
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
|
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
|
||||||
<exclude name="PSR12.Classes.OpeningBraceSpace.Found"/>
|
<exclude name="PSR12.Classes.OpeningBraceSpace.Found"/>
|
||||||
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine"/>
|
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine"/>
|
||||||
<exclude name="Generic.Files.LineLength"/>
|
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- Require opening braces to be on the same line (1TBS / K&R style) -->
|
<!-- Require opening braces to be on the same line (1TBS / K&R style) -->
|
||||||
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
|
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
|
||||||
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
|
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
|
||||||
|
|
||||||
|
<!-- Enforce exactly 1 blank line before/after a class closing/opening brace -->
|
||||||
|
<rule ref="Squiz.WhiteSpace.ClassOpeningSpacing">
|
||||||
|
<properties>
|
||||||
|
<property name="spacing" value="1"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<rule ref="Squiz.WhiteSpace.ClassClosingSpacing">
|
||||||
|
<properties>
|
||||||
|
<property name="spacing" value="1"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
<!-- Enforce 2-space indentation instead of 4 -->
|
<!-- Enforce 2-space indentation instead of 4 -->
|
||||||
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class ApiController extends Controller {
|
|||||||
public function postResultAdd(Request $request, Response $response, array $args): Response {
|
public function postResultAdd(Request $request, Response $response, array $args): Response {
|
||||||
$params = (array)$request->getParsedBody();
|
$params = (array)$request->getParsedBody();
|
||||||
|
|
||||||
$result = new Result;
|
$result = new Result();
|
||||||
$result->test_id = $params['result_test'];
|
$result->test_id = $params['result_test'];
|
||||||
$result->benchmark_id = $params['result_benchmark'];
|
$result->benchmark_id = $params['result_benchmark'];
|
||||||
$result->average = $params['result_avg'];
|
$result->average = $params['result_avg'];
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class ComponentController extends Controller {
|
|||||||
public function postAdd(Request $request, Response $response): Response {
|
public function postAdd(Request $request, Response $response): Response {
|
||||||
$params = (array)$request->getParsedBody();
|
$params = (array)$request->getParsedBody();
|
||||||
|
|
||||||
$component = new Component;
|
$component = new Component();
|
||||||
$component->name = $params['component_name'];
|
$component->name = $params['component_name'];
|
||||||
$component->type = $params['component_type'];
|
$component->type = $params['component_type'];
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class TestController extends Controller {
|
|||||||
public function postAdd(Request $request, Response $response): Response {
|
public function postAdd(Request $request, Response $response): Response {
|
||||||
$params = (array)$request->getParsedBody();
|
$params = (array)$request->getParsedBody();
|
||||||
|
|
||||||
$test = new Test;
|
$test = new Test();
|
||||||
$test->title = $params['test_title'];
|
$test->title = $params['test_title'];
|
||||||
$test->description = $params['test_description'];
|
$test->description = $params['test_description'];
|
||||||
$test->component_id = $params['test_component'];
|
$test->component_id = $params['test_component'];
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
|||||||
use Slim\Factory\AppFactory;
|
use Slim\Factory\AppFactory;
|
||||||
use Slim\Views\Twig;
|
use Slim\Views\Twig;
|
||||||
use Slim\Views\TwigMiddleware;
|
use Slim\Views\TwigMiddleware;
|
||||||
|
|
||||||
use BitGoblin\Colossus\Middleware\AppInfo;
|
use BitGoblin\Colossus\Middleware\AppInfo;
|
||||||
|
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$capsule = new \Illuminate\Database\Capsule\Manager;
|
$capsule = new \Illuminate\Database\Capsule\Manager();
|
||||||
$capsule->addConnection($config->get('database'));
|
$capsule->addConnection($config->get('database'));
|
||||||
$capsule->setAsGlobal();
|
$capsule->setAsGlobal();
|
||||||
$capsule->bootEloquent();
|
$capsule->bootEloquent();
|
||||||
|
|||||||
+9
-9
@@ -4,13 +4,13 @@ use Slim\Routing\RouteCollectorProxy;
|
|||||||
|
|
||||||
$app->get('/', '\\BitGoblin\\Colossus\\Controllers\\HomeController:getIndex')->setName('dashboard');
|
$app->get('/', '\\BitGoblin\\Colossus\\Controllers\\HomeController:getIndex')->setName('dashboard');
|
||||||
|
|
||||||
$app->group('/benchmark', function(RouteCollectorProxy $group) {
|
$app->group('/benchmark', function (RouteCollectorProxy $group) {
|
||||||
$group->get('', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getIndex')->setName('benchmark.index');
|
$group->get('', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getIndex')->setName('benchmark.index');
|
||||||
$group->get('/list', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getList')->setName('benchmark.list');
|
$group->get('/list', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getList')->setName('benchmark.list');
|
||||||
$group->get('/add', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getAdd')->setName('benchmark.add');
|
$group->get('/add', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getAdd')->setName('benchmark.add');
|
||||||
$group->post('/add', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:postAdd');
|
$group->post('/add', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:postAdd');
|
||||||
|
|
||||||
$group->group('/{benchmark_id}', function(RouteCollectorProxy $benchmark) {
|
$group->group('/{benchmark_id}', function (RouteCollectorProxy $benchmark) {
|
||||||
$benchmark->get('', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getView')->setName('benchmark.view');
|
$benchmark->get('', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getView')->setName('benchmark.view');
|
||||||
|
|
||||||
$benchmark->get('/edit', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getEdit')->setName('benchmark.edit');
|
$benchmark->get('/edit', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getEdit')->setName('benchmark.edit');
|
||||||
@@ -18,13 +18,13 @@ $app->group('/benchmark', function(RouteCollectorProxy $group) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$app->group('/component', function(RouteCollectorProxy $group) {
|
$app->group('/component', function (RouteCollectorProxy $group) {
|
||||||
$group->get('', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getIndex')->setName('component.index');
|
$group->get('', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getIndex')->setName('component.index');
|
||||||
$group->get('/list', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getList')->setName('component.list');
|
$group->get('/list', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getList')->setName('component.list');
|
||||||
$group->get('/add', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getAdd')->setName('component.add');
|
$group->get('/add', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getAdd')->setName('component.add');
|
||||||
$group->post('/add', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:postAdd');
|
$group->post('/add', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:postAdd');
|
||||||
|
|
||||||
$group->group('/{component_id}', function(RouteCollectorProxy $component) {
|
$group->group('/{component_id}', function (RouteCollectorProxy $component) {
|
||||||
$component->get('', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getView')->setName('component.view');
|
$component->get('', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getView')->setName('component.view');
|
||||||
|
|
||||||
$component->get('/edit', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getEdit')->setName('component.edit');
|
$component->get('/edit', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getEdit')->setName('component.edit');
|
||||||
@@ -32,12 +32,12 @@ $app->group('/component', function(RouteCollectorProxy $group) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$app->group('/test', function(RouteCollectorProxy $group) {
|
$app->group('/test', function (RouteCollectorProxy $group) {
|
||||||
$group->get('', '\\BitGoblin\\Colossus\\Controllers\\TestController:getList')->setName('test.list');
|
$group->get('', '\\BitGoblin\\Colossus\\Controllers\\TestController:getList')->setName('test.list');
|
||||||
$group->get('/add', '\\BitGoblin\\Colossus\\Controllers\\TestController:getAdd')->setName('test.add');
|
$group->get('/add', '\\BitGoblin\\Colossus\\Controllers\\TestController:getAdd')->setName('test.add');
|
||||||
$group->post('/add', '\\BitGoblin\\Colossus\\Controllers\\TestController:postAdd');
|
$group->post('/add', '\\BitGoblin\\Colossus\\Controllers\\TestController:postAdd');
|
||||||
|
|
||||||
$group->group('/{test_id}', function(RouteCollectorProxy $test) {
|
$group->group('/{test_id}', function (RouteCollectorProxy $test) {
|
||||||
$test->get('', '\\BitGoblin\\Colossus\\Controllers\\TestController:getView')->setName('test.view');
|
$test->get('', '\\BitGoblin\\Colossus\\Controllers\\TestController:getView')->setName('test.view');
|
||||||
|
|
||||||
$test->get('/edit', '\\BitGoblin\\Colossus\\Controllers\\TestController:getEdit')->setName('test.edit');
|
$test->get('/edit', '\\BitGoblin\\Colossus\\Controllers\\TestController:getEdit')->setName('test.edit');
|
||||||
@@ -47,12 +47,12 @@ $app->group('/test', function(RouteCollectorProxy $group) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$app->group('/reports', function(RouteCollectorProxy $group) {
|
$app->group('/reports', function (RouteCollectorProxy $group) {
|
||||||
$group->get('/generate', '\\BitGoblin\\Colossus\Controllers\ReportController:getGenerate')->setName('reports.generate');
|
$group->get('/generate', '\\BitGoblin\\Colossus\Controllers\ReportController:getGenerate')->setName('reports.generate');
|
||||||
});
|
});
|
||||||
|
|
||||||
$app->group('/api', function(RouteCollectorProxy $group) {
|
$app->group('/api', function (RouteCollectorProxy $group) {
|
||||||
$group->group('/v1', function(RouteCollectorProxy $apiv1) {
|
$group->group('/v1', function (RouteCollectorProxy $apiv1) {
|
||||||
$apiv1->get('/benchmark/details', '\\BitGoblin\\Colossus\\Controllers\\ApiController:getBenchmarkDetails')->setName('api.benchmarkDetails');
|
$apiv1->get('/benchmark/details', '\\BitGoblin\\Colossus\\Controllers\\ApiController:getBenchmarkDetails')->setName('api.benchmarkDetails');
|
||||||
$apiv1->get('/benchmark/tests', '\\BitGoblin\\Colossus\\Controllers\\ApiController:getBenchmarkTests')->setName('api.benchmarkTests');
|
$apiv1->get('/benchmark/tests', '\\BitGoblin\\Colossus\\Controllers\\ApiController:getBenchmarkTests')->setName('api.benchmarkTests');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user