1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-26 17:44:22 +02:00

adhere to (mostly) PSR12, check codestyle in CI

This commit is contained in:
Danny van Kooten
2025-01-11 20:21:41 +01:00
parent f440bb654d
commit c28df65f42
4 changed files with 13 additions and 8 deletions

View File

@@ -35,5 +35,8 @@ jobs:
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-progress
- name: Check codestyle
run: composer run-script check-codestyle
- name: Run test suite
run: composer run-script test

View File

@@ -1,4 +1,5 @@
<?php
/*
MIT License
@@ -13,7 +14,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
class AltoRouter
{
/**
* @var array Array of all routes (incl. named routes).
*/

View File

@@ -30,7 +30,8 @@
"classmap": ["AltoRouter.php"]
},
"scripts": {
"test": "vendor/bin/phpunit",
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php --define error_reporting=-1 -l"
"test": "phpunit",
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php --define error_reporting=-1 -l",
"check-codestyle": "phpcs -ns"
}
}

View File

@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<ruleset name="rules">
<description>rules</description>
<rule ref="PSR2"/>
<rule ref="PSR12">
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<file>tests</file>
<file>AltoRouter.php</file>
<file>examples/</file>
<arg name="colors"/>