-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from shadz3rg/feature-php74
Improve code-quality
- Loading branch information
Showing
55 changed files
with
2,507 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: PHP Composer | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: xhrequest/symfony_common:version-1.10.0-pcov | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Run test suite | ||
run: composer run-script test | ||
|
||
- name: Check code quality | ||
run: composer run-script cq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.idea/ | ||
vendor/ | ||
composer.lock | ||
composer.phar | ||
.htaccess | ||
index.php | ||
static/ | ||
.php_cs.cache | ||
.php-cs-fixer.cache | ||
.phpunit.result.cache | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create()->in('src/'); | ||
|
||
$config = new PhpCsFixer\Config(); | ||
return $config | ||
->setRules([ | ||
'@Symfony' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'yoda_style' => false, | ||
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'] | ||
]) | ||
->setFinder($finder); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '3.7' | ||
|
||
x-php: &common-php-container | ||
image: xhrequest/symfony_common:version-1.10.0-pcov | ||
working_dir: /var/www/app | ||
volumes: | ||
- .:/var/www/app:cached | ||
|
||
services: | ||
test_platform: | ||
<<: *common-php-container | ||
command: ["php", "-v"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
includes: | ||
- vendor/ekino/phpstan-banned-code/extension.neon | ||
parameters: | ||
paths: | ||
- src/ | ||
- tests/ | ||
banned_code: | ||
nodes: | ||
- type: Expr_FuncCall | ||
functions: | ||
- dump | ||
- var_dump | ||
- echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
stopOnError="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
bootstrap="vendor/autoload.php"> | ||
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd" backupGlobals="false" defaultTestSuite="Unit"> | ||
<coverage> | ||
<include> | ||
<directory>.</directory> | ||
</include> | ||
<exclude> | ||
<directory suffix=".php">tests</directory> | ||
<directory>vendor</directory> | ||
</exclude> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Main Suite"> | ||
<directory>tests/</directory> | ||
<testsuite name="Unit"> | ||
<directory>tests/Unit</directory> | ||
</testsuite> | ||
<testsuite name="Integration"> | ||
<directory>tests/Integration</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> | ||
<php> | ||
<ini name="memory_limit" value="512M"/> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.