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 #38 from Progi1984/improveProject
- Removed Scrutinizer - Removed Travis CI - Migrated to Github Actions - Added PHPStan - Set minimal support to PHP 7.1
- Loading branch information
Showing
37 changed files
with
854 additions
and
622 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,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: composer | ||
directory: "/" | ||
schedule: | ||
interval: monthly | ||
time: "11:00" | ||
open-pull-requests-limit: 10 | ||
assignees: | ||
- Progi1984 |
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,98 @@ | ||
name: PHPPresentation | ||
on: [push, pull_request] | ||
jobs: | ||
php-cs-fixer: | ||
name: PHP CS Fixer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Validate composer config | ||
run: composer validate --strict | ||
|
||
- name: Composer Install | ||
run: composer global require friendsofphp/php-cs-fixer | ||
|
||
- name: Add environment path | ||
run: export PATH="$PATH:$HOME/.composer/vendor/bin" | ||
|
||
- name: Run PHPCSFixer | ||
run: php-cs-fixer fix --dry-run --diff | ||
|
||
phpmd: | ||
name: PHP Mess Detector | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
extensions: gd, xml, zip | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Composer Install | ||
run: composer install --ansi --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Run phpmd | ||
run: ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist | ||
|
||
phpstan: | ||
name: PHP Static Analysis | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.1', '7.2', '7.3', '7.4', '8.0'] #, '8.1' | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: gd, xml, zip | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Composer Install | ||
run: composer install --ansi --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Run phpstan | ||
run: ./vendor/bin/phpstan analyse -c phpstan.neon.dist | ||
|
||
phpunit: | ||
name: PHPUnit | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.1', '7.2', '7.3', '7.4', '8.0'] #, '8.1' | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: gd, xml, zip | ||
coverage: xdebug | ||
|
||
- name: Generate Locale (for tests) | ||
run: sudo locale-gen de_DE.UTF-8 && sudo update-locale | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Composer Install | ||
run: composer install --ansi --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Run phpunit | ||
run: ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/clover.xml | ||
|
||
- name: Upload coverage results to Coveralls | ||
if: matrix.php == '7.3' | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar | ||
chmod +x php-coveralls.phar | ||
php php-coveralls.phar --coverage_clover=build/clover.xml --json_path=build/coveralls-upload.json -vvv |
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,37 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<ruleset name="PHPPresentation PHP Mess Detector Rule Set" | ||
xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | ||
<rule ref="rulesets/naming.xml"> | ||
<exclude name="LongVariable" /> | ||
<exclude name="ShortClassName" /> | ||
</rule> | ||
<rule ref="rulesets/naming.xml/LongVariable"> | ||
<properties> | ||
<property name="maximum" value="32" /> | ||
</properties> | ||
</rule> | ||
<rule ref="rulesets/naming.xml/ShortClassName"> | ||
<properties> | ||
<property name="minimum" value="2" /> | ||
</properties> | ||
</rule> | ||
<rule ref="rulesets/design.xml/ExitExpression" /> | ||
<rule ref="rulesets/design.xml/EvalExpression" /> | ||
<rule ref="rulesets/design.xml/GotoStatement" /> | ||
<rule ref="rulesets/design.xml/DepthOfInheritance" /> | ||
<rule ref="rulesets/design.xml/CouplingBetweenObjects"> | ||
<properties> | ||
<property name="maximum" value="13" /> | ||
</properties> | ||
</rule> | ||
<rule ref="rulesets/design.xml/NumberOfChildren"> | ||
<properties> | ||
<property name="minimum" value="15" /> | ||
</properties> | ||
</rule> | ||
<rule ref="rulesets/unusedcode.xml" /> | ||
<rule ref="rulesets/controversial.xml" /> | ||
</ruleset> |
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,25 +1,7 @@ | ||
.DS_Store | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
Thumbs.db | ||
Desktop.ini | ||
.idea | ||
build/ | ||
phpunit.xml | ||
composer.phar | ||
vendor | ||
*.settings | ||
*.project | ||
*.buildpath | ||
|
||
/samples/results | ||
/phpunit.bat | ||
/todo.txt | ||
/samples/Sample_00_Test.php | ||
/samples/#47 | ||
/samples/#70 | ||
/samples/#71 | ||
/samples/Github_*.* | ||
/samples/#83/*.lnk | ||
## PHPCSFixer | ||
/.php-cs-fixer.cache | ||
## PHPUnit | ||
/.phpunit.result.cache | ||
## Dependencies | ||
/composer.lock | ||
/vendor/ |
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,44 @@ | ||
<?php | ||
|
||
$config = new PhpCsFixer\Config(); | ||
|
||
$config | ||
->setUsingCache(true) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@Symfony' => true, | ||
'array_indentation' => true, | ||
'cast_spaces' => [ | ||
'space' => 'single', | ||
], | ||
'combine_consecutive_issets' => true, | ||
'concat_space' => [ | ||
'spacing' => 'one', | ||
], | ||
'error_suppression' => [ | ||
'mute_deprecation_error' => false, | ||
'noise_remaining_usages' => false, | ||
'noise_remaining_usages_exclude' => [], | ||
], | ||
'function_to_constant' => false, | ||
'method_chaining_indentation' => true, | ||
'no_alias_functions' => false, | ||
'no_superfluous_phpdoc_tags' => false, | ||
'non_printable_character' => [ | ||
'use_escape_sequences_in_strings' => true, | ||
], | ||
'phpdoc_align' => [ | ||
'align' => 'left', | ||
], | ||
'phpdoc_summary' => false, | ||
'protected_to_private' => false, | ||
'self_accessor' => false, | ||
'yoda_style' => false, | ||
'single_line_throw' => false, | ||
'no_alias_language_construct_call' => false, | ||
]) | ||
->getFinder() | ||
->in(__DIR__) | ||
->exclude('vendor'); | ||
|
||
return $config; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
parameters: | ||
level: 6 | ||
bootstrapFiles: | ||
- tests/bootstrap.php | ||
paths: | ||
- src | ||
- tests | ||
reportUnmatchedIgnoredErrors: false | ||
ignoreErrors: | ||
|
||
## Remove after remove ArrayObject | ||
treatPhpDocTypesAsCertain: false |
Oops, something went wrong.