Skip to content

Commit 0b08fa4

Browse files
committedMay 22, 2020
Add PHPCS and PHPStan
1 parent fa68fbf commit 0b08fa4

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
.phpcs-cache
12
composer.lock
23
vendor/

‎composer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
}
1111
],
1212
"minimum-stability": "stable",
13+
"require": {
14+
"ext-json": "*"
15+
},
1316
"require-dev": {
14-
"squizlabs/php_codesniffer": "^3.5"
17+
"squizlabs/php_codesniffer": "^3.5",
18+
"phpstan/phpstan": "^0.12.25",
19+
"phpstan/phpstan-deprecation-rules": "^0.12.3"
1520
},
1621
"autoload": {
1722
"psr-4": {

‎phpcs.xml.dist

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
4+
5+
<arg name="basepath" value="."/>
6+
<arg name="cache" value=".phpcs-cache"/>
7+
<arg name="colors"/>
8+
<arg name="extensions" value="php"/>
9+
<arg name="report" value="emacs"/>
10+
<arg value="p"/>
11+
12+
<config name="ignore_warnings_on_exit" value="1"/>
13+
14+
<rule ref="PSR12"/>
15+
16+
<file>src</file>
17+
</ruleset>

‎phpstan.neon.dist

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
includes:
3+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
4+
5+
parameters:
6+
level: 8
7+
paths:
8+
- src
9+
autoload_files:
10+
- vendor/squizlabs/php_codesniffer/autoload.php
11+
checkMissingIterableValueType: false

‎src/Report/GitlabReport.php

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
class GitlabReport implements Report
2121
{
2222
/**
23+
* @param File $phpcsFile
2324
* @inheritDoc
2425
*/
2526
public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80): bool

0 commit comments

Comments
 (0)