Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Static Analysis

on: push

jobs:
static_analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest --no-scripts
- name: phpqa
uses: docker://zdenekdrahos/phpqa:v1.23.3
with:
args: phpqa
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
/build/
/vendor/
/composer.phar

.php_cs.cache
25 changes: 25 additions & 0 deletions .phpcs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

$header = <<<'EOF'
This file is part of PHP CS Fixer.
(c) Fabien Potencier <fabien@symfony.com>
Dariusz Rumiński <dariusz.ruminski@gmail.com>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;

$finder = PhpCsFixer\Finder::create()
->exclude('./app')
->in(__DIR__)
->append([__DIR__.'/php-cs-fixer'])
;

$config = PhpCsFixer\Config::create()
->setRiskyAllowed(false)
->setRules([
'@PSR2' => true,
])
->setFinder($finder)
;

return $config;
54 changes: 54 additions & 0 deletions .phpqa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
phpqa:
# default CLI options - https://github.com/EdgedesignCZ/phpqa#analyze
# can be overriden by CLI: phpqa --tools phpcs:1
analyzedDirs: ./
buildDir: build/
ignoredDirs: build,vendor,app,bin, web
ignoredFiles: ""
report: false
execution: parallel
output: cli
tools: phpmetrics:0,phploc:0,phpcs:0,php-cs-fixer:0,phpmd:0,pdepend:0,phpcpd:0,security-checker:0,parallel-lint:0
# array definition and allowed errors count is supported too
# tools: [phploc, phpcs:0]
verbose: false

# Other config
# Php file extensions to parse.
extensions:
- php

phpcs:
# alternatively you can use an array to define multiple standards (https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage#specifying-a-coding-standard)
standard: PSR2
# number of allowed errors is compared with warnings+errors, or just errors from checkstyle.xml
ignoreWarnings: false
# https://github.com/squizlabs/PHP_CodeSniffer/wiki/Reporting
reports:
cli:
- full
file:
# checkstyle is always included and overriden
checkstyle: checkstyle.xml
# you can include custom reports (https://github.com/wikidi/codesniffer/blob/master/reports/wikidi/Summary.php#L39)
# ./vendor/owner/package/src/MySummaryReport.php: phpcs-summary.html

php-cs-fixer:
config: .phpcs.dist

phpmd:

pdepend:
# coverageReport: build/coverage-clover.xml

phpcpd:
minLines: 5
minTokens: 70

phpmetrics:
# v1
config: null
# v2
git: false
# junit: build/log-junit.xml
# composer: composer.json
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.PHONY: qa
qa: vendor
docker run --rm -it -v ${PWD}:/app:rw -w /app zdenekdrahos/phpqa:v1.23.3 phpqa

vendor: composer.json composer.lock
docker run --rm -it -v ${PWD}:/app:rw -w /app composer:latest validate
docker run --rm -it -v ${PWD}:/app:rw -w /app composer:latest install
docker run --rm -it -v ${PWD}:/app:rw -w /app composer:latest normalize
Loading