Skip to content

Commit f58ed68

Browse files
author
Artur (Seti) Łabudziński
committed
Added new phpunit
Added codesniffer and phpstan Fixed some PSR-2 misstakes
1 parent 4ef3b19 commit f58ed68

31 files changed

+1552
-1398
lines changed

composer.json

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,44 @@
1515
"mockery/mockery": "^0.9.4"
1616
},
1717
"require-dev": {
18-
"phpunit/phpunit": "~4.4"
18+
"phpunit/phpunit": "~6.1",
19+
"squizlabs/php_codesniffer": "^2.0",
20+
"frenck/php-compatibility": "^7.0.0",
21+
"dealerdirect/phpcodesniffer-composer-installer": "~0.4",
22+
"jakub-onderka/php-parallel-lint": "~0.9",
23+
"phpstan/phpstan": "~0.7"
1924
},
2025
"license": "Apache 2.0",
2126
"authors": [
22-
{
23-
"name": "Artur (Seti) Łabudziński",
24-
"email": "[email protected]",
25-
"homepage": "http://chibi.pl/"
26-
},
27+
{
28+
"name": "Artur (Seti) Łabudziński",
29+
"email": "[email protected]",
30+
"homepage": "http://chibi.pl/"
31+
},
2732
{
2833
"name": "KwangSeob Jeong",
2934
"email": "[email protected]",
30-
"homepage": "http://lesstif.com/",
31-
"Role": "First Authour / Creator"
35+
"homepage": "http://lesstif.com/"
3236
}
3337
],
3438
"autoload": {
3539
"psr-4" : {
3640
"Jira\\Api\\" : "src/"
3741
}
42+
},
43+
"scripts": {
44+
"install-codesniffs": [
45+
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
46+
],
47+
"autofix-code": [
48+
"sh ./vendor/bin/phpcbf"
49+
],
50+
"phpstan": [
51+
"sh ./vendor/bin/phpstan analyse -c phpstan.neon -l 7 src"
52+
],
53+
"auto": [
54+
"@autofix-code",
55+
"@phpstan"
56+
]
3857
}
3958
}

phpcs.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Coding Standard Config">
3+
<description>standard config file</description>
4+
5+
<arg value="n" />
6+
<arg name="report" value="full" />
7+
<arg name="encoding" value="UTF-8" />
8+
<arg name="extensions" value="php" />
9+
10+
<!-- Run against the PHPCompatibility ruleset -->
11+
<rule ref="PHPCompatibility">
12+
<!-- this is library, anyone using it should fix that, so excluding this -->
13+
<exclude name="PHPCompatibility.PHP.DefaultTimezoneRequired"/>
14+
</rule>
15+
<config name="testVersion" value="7.0-7.1" />
16+
17+
18+
<rule ref="ZEND" />
19+
20+
<file>./src</file>
21+
</ruleset>

phpstan.neon

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Configuration for PHP Static Analysis
2+
# https://github.com/phpstan/phpstan
3+
parameters:
4+
bootstrap: %rootDir%/../../../vendor/autoload.php
5+
6+
fileExtensions:
7+
- php
8+
9+
# Do not treat unmatched patterns as errors
10+
reportUnmatchedIgnoredErrors: false
11+
12+
universalObjectCratesClasses: {}
13+
14+
ignoreErrors: {}

0 commit comments

Comments
 (0)