mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-07-09 19:06:29 +02:00
adhere to (mostly) PSR12, check codestyle in CI
This commit is contained in:
3
.github/workflows/php.yml
vendored
3
.github/workflows/php.yml
vendored
@ -35,5 +35,8 @@ jobs:
|
|||||||
if: steps.composer-cache.outputs.cache-hit != 'true'
|
if: steps.composer-cache.outputs.cache-hit != 'true'
|
||||||
run: composer install --no-progress
|
run: composer install --no-progress
|
||||||
|
|
||||||
|
- name: Check codestyle
|
||||||
|
run: composer run-script check-codestyle
|
||||||
|
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
run: composer run-script test
|
run: composer run-script test
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
@ -13,7 +14,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|||||||
|
|
||||||
class AltoRouter
|
class AltoRouter
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array Array of all routes (incl. named routes).
|
* @var array Array of all routes (incl. named routes).
|
||||||
*/
|
*/
|
||||||
|
@ -30,7 +30,8 @@
|
|||||||
"classmap": ["AltoRouter.php"]
|
"classmap": ["AltoRouter.php"]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vendor/bin/phpunit",
|
"test": "phpunit",
|
||||||
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php --define error_reporting=-1 -l"
|
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php --define error_reporting=-1 -l",
|
||||||
|
"check-codestyle": "phpcs -ns"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<ruleset name="rules">
|
<ruleset name="rules">
|
||||||
<description>rules</description>
|
<description>rules</description>
|
||||||
<rule ref="PSR2"/>
|
<rule ref="PSR12">
|
||||||
|
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
|
||||||
|
</rule>
|
||||||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
|
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
|
||||||
<file>tests</file>
|
|
||||||
<file>AltoRouter.php</file>
|
<file>AltoRouter.php</file>
|
||||||
<file>examples/</file>
|
<file>examples/</file>
|
||||||
<arg name="colors"/>
|
<arg name="colors"/>
|
||||||
|
Reference in New Issue
Block a user