Skip to content

Commit a3f6152

Browse files
authored
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
2 parents 2caf520 + 26a63a1 commit a3f6152

37 files changed

+854
-622
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
time: "11:00"
8+
open-pull-requests-limit: 10
9+
assignees:
10+
- Progi1984

.github/workflows/php.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: PHPPresentation
2+
on: [push, pull_request]
3+
jobs:
4+
php-cs-fixer:
5+
name: PHP CS Fixer
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Setup PHP
9+
uses: shivammathur/setup-php@v2
10+
with:
11+
php-version: '7.4'
12+
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
13+
- uses: actions/checkout@v2
14+
15+
- name: Validate composer config
16+
run: composer validate --strict
17+
18+
- name: Composer Install
19+
run: composer global require friendsofphp/php-cs-fixer
20+
21+
- name: Add environment path
22+
run: export PATH="$PATH:$HOME/.composer/vendor/bin"
23+
24+
- name: Run PHPCSFixer
25+
run: php-cs-fixer fix --dry-run --diff
26+
27+
phpmd:
28+
name: PHP Mess Detector
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: '7.4'
35+
extensions: gd, xml, zip
36+
- uses: actions/checkout@v2
37+
38+
- name: Composer Install
39+
run: composer install --ansi --prefer-dist --no-interaction --no-progress
40+
41+
- name: Run phpmd
42+
run: ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist
43+
44+
phpstan:
45+
name: PHP Static Analysis
46+
runs-on: ubuntu-latest
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
php: ['7.1', '7.2', '7.3', '7.4', '8.0'] #, '8.1'
51+
steps:
52+
- name: Setup PHP
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php }}
56+
extensions: gd, xml, zip
57+
- uses: actions/checkout@v2
58+
59+
- name: Composer Install
60+
run: composer install --ansi --prefer-dist --no-interaction --no-progress
61+
62+
- name: Run phpstan
63+
run: ./vendor/bin/phpstan analyse -c phpstan.neon.dist
64+
65+
phpunit:
66+
name: PHPUnit
67+
runs-on: ubuntu-latest
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
php: ['7.1', '7.2', '7.3', '7.4', '8.0'] #, '8.1'
72+
steps:
73+
- name: Setup PHP
74+
uses: shivammathur/setup-php@v2
75+
with:
76+
php-version: ${{ matrix.php }}
77+
extensions: gd, xml, zip
78+
coverage: xdebug
79+
80+
- name: Generate Locale (for tests)
81+
run: sudo locale-gen de_DE.UTF-8 && sudo update-locale
82+
83+
- uses: actions/checkout@v2
84+
85+
- name: Composer Install
86+
run: composer install --ansi --prefer-dist --no-interaction --no-progress
87+
88+
- name: Run phpunit
89+
run: ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/clover.xml
90+
91+
- name: Upload coverage results to Coveralls
92+
if: matrix.php == '7.3'
93+
env:
94+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
run: |
96+
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar
97+
chmod +x php-coveralls.phar
98+
php php-coveralls.phar --coverage_clover=build/clover.xml --json_path=build/coveralls-upload.json -vvv

.github/workflows/phpmd.xml.dist

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<ruleset name="PHPPresentation PHP Mess Detector Rule Set"
3+
xmlns="http://pmd.sf.net/ruleset/1.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
6+
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
7+
<rule ref="rulesets/naming.xml">
8+
<exclude name="LongVariable" />
9+
<exclude name="ShortClassName" />
10+
</rule>
11+
<rule ref="rulesets/naming.xml/LongVariable">
12+
<properties>
13+
<property name="maximum" value="32" />
14+
</properties>
15+
</rule>
16+
<rule ref="rulesets/naming.xml/ShortClassName">
17+
<properties>
18+
<property name="minimum" value="2" />
19+
</properties>
20+
</rule>
21+
<rule ref="rulesets/design.xml/ExitExpression" />
22+
<rule ref="rulesets/design.xml/EvalExpression" />
23+
<rule ref="rulesets/design.xml/GotoStatement" />
24+
<rule ref="rulesets/design.xml/DepthOfInheritance" />
25+
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
26+
<properties>
27+
<property name="maximum" value="13" />
28+
</properties>
29+
</rule>
30+
<rule ref="rulesets/design.xml/NumberOfChildren">
31+
<properties>
32+
<property name="minimum" value="15" />
33+
</properties>
34+
</rule>
35+
<rule ref="rulesets/unusedcode.xml" />
36+
<rule ref="rulesets/controversial.xml" />
37+
</ruleset>

.gitignore

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
1-
.DS_Store
2-
._*
3-
.Spotlight-V100
4-
.Trashes
5-
Thumbs.db
6-
Desktop.ini
7-
.idea
8-
build/
9-
phpunit.xml
10-
composer.phar
11-
vendor
12-
*.settings
13-
*.project
14-
*.buildpath
15-
16-
/samples/results
17-
/phpunit.bat
18-
/todo.txt
19-
/samples/Sample_00_Test.php
20-
/samples/#47
21-
/samples/#70
22-
/samples/#71
23-
/samples/Github_*.*
24-
/samples/#83/*.lnk
1+
## PHPCSFixer
2+
/.php-cs-fixer.cache
3+
## PHPUnit
4+
/.phpunit.result.cache
5+
## Dependencies
256
/composer.lock
7+
/vendor/

.php-cs-fixer.dist.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
$config = new PhpCsFixer\Config();
4+
5+
$config
6+
->setUsingCache(true)
7+
->setRiskyAllowed(true)
8+
->setRules([
9+
'@Symfony' => true,
10+
'array_indentation' => true,
11+
'cast_spaces' => [
12+
'space' => 'single',
13+
],
14+
'combine_consecutive_issets' => true,
15+
'concat_space' => [
16+
'spacing' => 'one',
17+
],
18+
'error_suppression' => [
19+
'mute_deprecation_error' => false,
20+
'noise_remaining_usages' => false,
21+
'noise_remaining_usages_exclude' => [],
22+
],
23+
'function_to_constant' => false,
24+
'method_chaining_indentation' => true,
25+
'no_alias_functions' => false,
26+
'no_superfluous_phpdoc_tags' => false,
27+
'non_printable_character' => [
28+
'use_escape_sequences_in_strings' => true,
29+
],
30+
'phpdoc_align' => [
31+
'align' => 'left',
32+
],
33+
'phpdoc_summary' => false,
34+
'protected_to_private' => false,
35+
'self_accessor' => false,
36+
'yoda_style' => false,
37+
'single_line_throw' => false,
38+
'no_alias_language_construct_call' => false,
39+
])
40+
->getFinder()
41+
->in(__DIR__)
42+
->exclude('vendor');
43+
44+
return $config;

.scrutinizer.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.travis_shell_after_success.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

composer.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"keywords": ["PHP","Office","Common","component"],
55
"homepage": "http://phpoffice.github.io",
66
"type": "library",
7-
"license": "LGPL",
7+
"license": "LGPL-3.0-only",
88
"authors": [
99
{
1010
"name": "Mark Baker"
@@ -15,16 +15,13 @@
1515
}
1616
],
1717
"require": {
18-
"php": ">=5.3.0",
18+
"php": ">=7.1",
1919
"pclzip/pclzip": "^2.8"
2020
},
2121
"require-dev": {
22-
"phpunit/phpunit": "^4.8.36 || ^7.0",
23-
"phpdocumentor/phpdocumentor":"2.*",
22+
"phpunit/phpunit": ">=7",
2423
"phpmd/phpmd": "2.*",
25-
"sebastian/phpcpd": "2.*",
26-
"phploc/phploc": "2.*",
27-
"squizlabs/php_codesniffer": "2.*"
24+
"phpstan/phpstan": "^0.12.88"
2825
},
2926
"autoload": {
3027
"psr-4": {

phpstan.neon.dist

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
parameters:
2+
level: 6
3+
bootstrapFiles:
4+
- tests/bootstrap.php
5+
paths:
6+
- src
7+
- tests
8+
reportUnmatchedIgnoredErrors: false
9+
ignoreErrors:
10+
11+
## Remove after remove ArrayObject
12+
treatPhpDocTypesAsCertain: false

0 commit comments

Comments
 (0)