Skip to content

Commit 55ffe9c

Browse files
committed
Project skeleton
1 parent a9cebd8 commit 55ffe9c

12 files changed

+262
-0
lines changed

.editorconfig

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
9+
[*.{php,phpt}]
10+
indent_style = tab
11+
indent_size = 4
12+
13+
[*.xml]
14+
indent_style = tab
15+
indent_size = 4
16+
17+
[*.neon]
18+
indent_style = tab
19+
indent_size = 4
20+
21+
[*.{yaml,yml}]
22+
indent_style = space
23+
indent_size = 2
24+
25+
[composer.json]
26+
indent_style = tab
27+
indent_size = 4

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/tests export-ignore

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/composer.lock
2+
/vendor

.travis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: php
2+
php:
3+
- 7.1
4+
- 7.2
5+
before_script:
6+
- composer self-update
7+
- composer install
8+
script:
9+
- vendor/bin/phing
10+
- >
11+
wget https://github.com/maglnet/ComposerRequireChecker/releases/download/0.2.1/composer-require-checker.phar
12+
&& php composer-require-checker.phar check composer.json

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
11
# Rules for detecting usage of deprecated classes, methods, properties, constants and traits.
22

3+
[![Build Status](https://travis-ci.org/phpstan/phpstan-deprecation-rules.svg)](https://travis-ci.org/phpstan/phpstan-deprecation-rules)
4+
[![Latest Stable Version](https://poser.pugx.org/phpstan/phpstan-deprecation-rules/v/stable)](https://packagist.org/packages/phpstan/phpstan-deprecation-rules)
5+
[![License](https://poser.pugx.org/phpstan/phpstan-deprecation-rules/license)](https://packagist.org/packages/phpstan/phpstan-deprecation-rules)
6+
7+
## Usage
8+
9+
To use these rules, require it in [Composer](https://getcomposer.org/):
10+
11+
```
12+
composer require --dev phpstan/phpstan-deprecation-rules
13+
```
14+
15+
And include rules.neon in your project's PHPStan config:
16+
17+
```
18+
includes:
19+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
20+
```

build.xml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project name="PHPStan deprecation rules" default="check">
3+
4+
<target name="check" depends="
5+
composer,
6+
lint,
7+
cs,
8+
tests,
9+
phpstan
10+
"/>
11+
12+
<target name="composer">
13+
<exec
14+
executable="composer"
15+
logoutput="true"
16+
passthru="true"
17+
checkreturn="true"
18+
>
19+
<arg value="install"/>
20+
</exec>
21+
</target>
22+
23+
<target name="lint">
24+
<exec
25+
executable="vendor/bin/parallel-lint"
26+
logoutput="true"
27+
passthru="true"
28+
checkreturn="true"
29+
>
30+
<arg path="src" />
31+
<arg path="tests" />
32+
</exec>
33+
</target>
34+
35+
<target name="cs">
36+
<exec
37+
executable="vendor/bin/phpcs"
38+
logoutput="true"
39+
passthru="true"
40+
checkreturn="true"
41+
>
42+
<arg value="--extensions=php"/>
43+
<arg value="--encoding=utf-8"/>
44+
<arg value="--tab-width=4"/>
45+
<arg value="-sp"/>
46+
<arg path="src"/>
47+
<arg path="tests"/>
48+
</exec>
49+
</target>
50+
51+
<target name="cs-fix">
52+
<exec
53+
executable="vendor/bin/phpcbf"
54+
logoutput="true"
55+
passthru="true"
56+
checkreturn="true"
57+
>
58+
<arg value="--extensions=php"/>
59+
<arg value="--encoding=utf-8"/>
60+
<arg value="--tab-width=4"/>
61+
<arg value="-sp"/>
62+
<arg path="src"/>
63+
<arg path="tests"/>
64+
</exec>
65+
</target>
66+
67+
<target name="tests">
68+
<exec
69+
executable="vendor/bin/phpunit"
70+
logoutput="true"
71+
passthru="true"
72+
checkreturn="true"
73+
>
74+
<arg value="-c"/>
75+
<arg value="tests/phpunit.xml"/>
76+
<arg path="tests"/>
77+
</exec>
78+
</target>
79+
80+
<target name="phpstan">
81+
<exec
82+
executable="vendor/bin/phpstan"
83+
logoutput="true"
84+
passthru="true"
85+
checkreturn="true"
86+
>
87+
<arg value="analyse"/>
88+
<arg value="-l"/>
89+
<arg value="7"/>
90+
<arg value="-c"/>
91+
<arg path="phpstan.neon"/>
92+
<arg path="src"/>
93+
<arg path="tests"/>
94+
</exec>
95+
</target>
96+
97+
</project>

composer.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "phpstan/phpstan-deprecation-rules",
3+
"description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.",
4+
"license": ["MIT"],
5+
"minimum-stability": "dev",
6+
"prefer-stable": true,
7+
"extra": {
8+
"branch-alias": {
9+
"dev-master": "0.10-dev"
10+
}
11+
},
12+
"require": {
13+
"php": "~7.1",
14+
"phpstan/phpstan": "^0.10",
15+
"nikic/php-parser": "^4.0"
16+
},
17+
"require-dev": {
18+
"consistence/coding-standard": "^3.0.1",
19+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
20+
"jakub-onderka/php-parallel-lint": "^1.0",
21+
"phing/phing": "^2.16.0",
22+
"phpstan/phpstan-phpunit": "^0.10",
23+
"phpunit/phpunit": "^7.0",
24+
"slevomat/coding-standard": "^4.5.2"
25+
},
26+
"autoload": {
27+
"psr-4": {
28+
"PHPStan\\": "src/"
29+
}
30+
}
31+
}

phpcs.xml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPStan deprecation rules">
3+
<rule ref="vendor/consistence/coding-standard/Consistence/ruleset.xml">
4+
<exclude name="Squiz.Functions.GlobalFunction.Found"/>
5+
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
6+
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
7+
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions"/>
8+
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
9+
</rule>
10+
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
11+
<properties>
12+
<property name="caseSensitive" value="false"/>
13+
</properties>
14+
</rule>
15+
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
16+
<properties>
17+
<property name="newlinesCountBetweenOpenTagAndDeclare" value="0"/>
18+
</properties>
19+
</rule>
20+
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
21+
<properties>
22+
<property name="usefulAnnotations" type="array" value="
23+
@dataProvider,
24+
@requires
25+
"/>
26+
</properties>
27+
</rule>
28+
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
29+
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowEqualOperators"/>
30+
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit"/>
31+
<rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming"/>
32+
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
33+
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator"/>
34+
<rule ref="SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile"/>
35+
<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
36+
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
37+
<properties>
38+
<property name="rootNamespaces" type="array" value="src=>PHPStan,tests=>PHPStan"/>
39+
</properties>
40+
</rule>
41+
<exclude-pattern>tests/*/data</exclude-pattern>
42+
</ruleset>

phpstan.neon

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
includes:
2+
- rules.neon

rules.neon

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rules: []

tests/bootstrap.php

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php declare(strict_types = 1);
2+
3+
require_once __DIR__ . '/../vendor/autoload.php';

tests/phpunit.xml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<phpunit
2+
bootstrap="bootstrap.php"
3+
colors="true"
4+
backupGlobals="false"
5+
backupStaticAttributes="false"
6+
beStrictAboutChangesToGlobalState="true"
7+
beStrictAboutOutputDuringTests="true"
8+
beStrictAboutTestsThatDoNotTestAnything="true"
9+
beStrictAboutTodoAnnotatedTests="true"
10+
failOnRisky="true"
11+
failOnWarning="true"
12+
>
13+
<filter>
14+
<whitelist>
15+
<directory suffix=".php">../src</directory>
16+
</whitelist>
17+
</filter>
18+
<logging>
19+
<log
20+
type="coverage-text"
21+
target="php://stdout"
22+
showUncoveredFiles="true"
23+
showOnlySummary="true"
24+
/>
25+
</logging>
26+
</phpunit>

0 commit comments

Comments
 (0)