Updating PHPCS ruleset to match a better style guideline (blank lines for opening/closing braces)
ci/woodpecker/manual/woodpecker Pipeline failed

This commit is contained in:
2026-07-21 13:26:12 -04:00
parent 936cf80ceb
commit 61900e22c6
8 changed files with 38 additions and 27 deletions
+13 -1
View File
@@ -16,13 +16,25 @@
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
<exclude name="PSR12.Classes.OpeningBraceSpace.Found"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnNewLine"/>
<exclude name="Generic.Files.LineLength"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
</rule>
<!-- Require opening braces to be on the same line (1TBS / K&R style) -->
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
<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 -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
+1 -1
View File
@@ -50,7 +50,7 @@ class ApiController extends Controller {
public function postResultAdd(Request $request, Response $response, array $args): Response {
$params = (array)$request->getParsedBody();
$result = new Result;
$result = new Result();
$result->test_id = $params['result_test'];
$result->benchmark_id = $params['result_benchmark'];
$result->average = $params['result_avg'];
+1 -1
View File
@@ -45,7 +45,7 @@ class ComponentController extends Controller {
public function postAdd(Request $request, Response $response): Response {
$params = (array)$request->getParsedBody();
$component = new Component;
$component = new Component();
$component->name = $params['component_name'];
$component->type = $params['component_type'];
+1 -1
View File
@@ -44,7 +44,7 @@ class TestController extends Controller {
public function postAdd(Request $request, Response $response): Response {
$params = (array)$request->getParsedBody();
$test = new Test;
$test = new Test();
$test->title = $params['test_title'];
$test->description = $params['test_description'];
$test->component_id = $params['test_component'];
-1
View File
@@ -8,7 +8,6 @@ use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use Slim\Views\Twig;
use Slim\Views\TwigMiddleware;
use BitGoblin\Colossus\Middleware\AppInfo;
require __DIR__ . '/../vendor/autoload.php';
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
$capsule = new \Illuminate\Database\Capsule\Manager;
$capsule = new \Illuminate\Database\Capsule\Manager();
$capsule->addConnection($config->get('database'));
$capsule->setAsGlobal();
$capsule->bootEloquent();
+9 -9
View File
@@ -4,13 +4,13 @@ use Slim\Routing\RouteCollectorProxy;
$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('/list', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getList')->setName('benchmark.list');
$group->get('/add', '\\BitGoblin\\Colossus\\Controllers\\BenchmarkController:getAdd')->setName('benchmark.add');
$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('/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('/list', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getList')->setName('component.list');
$group->get('/add', '\\BitGoblin\\Colossus\\Controllers\\ComponentController:getAdd')->setName('component.add');
$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('/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('/add', '\\BitGoblin\\Colossus\\Controllers\\TestController:getAdd')->setName('test.add');
$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('/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');
});
$app->group('/api', function(RouteCollectorProxy $group) {
$group->group('/v1', function(RouteCollectorProxy $apiv1) {
$app->group('/api', function (RouteCollectorProxy $group) {
$group->group('/v1', function (RouteCollectorProxy $apiv1) {
$apiv1->get('/benchmark/details', '\\BitGoblin\\Colossus\\Controllers\\ApiController:getBenchmarkDetails')->setName('api.benchmarkDetails');
$apiv1->get('/benchmark/tests', '\\BitGoblin\\Colossus\\Controllers\\ApiController:getBenchmarkTests')->setName('api.benchmarkTests');