Skip to content

Commit 9ac6b53

Browse files
committed
Build and tests
1 parent 59e65d6 commit 9ac6b53

15 files changed

+272
-10
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/tests export-ignore

build.xml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project name="PHPStan Nette class reflection extension" 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 value="--exclude"/>
31+
<arg path="tests/PHPStan/Analyser/data"/>
32+
<arg path="src" />
33+
<arg path="tests" />
34+
</exec>
35+
</target>
36+
37+
<target name="cs">
38+
<exec
39+
executable="vendor/bin/phpcs"
40+
logoutput="true"
41+
passthru="true"
42+
checkreturn="true"
43+
>
44+
<arg value="--standard=ruleset.xml"/>
45+
<arg value="--extensions=php"/>
46+
<arg value="--encoding=utf-8"/>
47+
<arg value="--tab-width=4"/>
48+
<arg value="--ignore=tests/*/data"/>
49+
<arg value="-sp"/>
50+
<arg path="src"/>
51+
<arg path="tests"/>
52+
</exec>
53+
</target>
54+
55+
<target name="cs-fix">
56+
<exec
57+
executable="vendor/bin/phpcbf"
58+
logoutput="true"
59+
passthru="true"
60+
checkreturn="true"
61+
>
62+
<arg value="--standard=ruleset.xml"/>
63+
<arg value="--extensions=php"/>
64+
<arg value="--encoding=utf-8"/>
65+
<arg value="--tab-width=4"/>
66+
<arg value="--ignore=tests/*/data"/>
67+
<arg value="-sp"/>
68+
<arg path="src"/>
69+
<arg path="tests"/>
70+
</exec>
71+
</target>
72+
73+
<target name="tests">
74+
<exec
75+
executable="vendor/bin/phpunit"
76+
logoutput="true"
77+
passthru="true"
78+
checkreturn="true"
79+
>
80+
<arg value="-c"/>
81+
<arg value="tests/phpunit.xml"/>
82+
<arg path="tests"/>
83+
</exec>
84+
</target>
85+
86+
<target name="phpstan">
87+
<exec
88+
executable="vendor/bin/phpstan"
89+
logoutput="true"
90+
passthru="true"
91+
checkreturn="true"
92+
>
93+
<arg value="analyse"/>
94+
<arg value="-c"/>
95+
<arg path="phpstan.neon"/>
96+
<arg path="src"/>
97+
<arg path="tests"/>
98+
</exec>
99+
</target>
100+
101+
</project>

composer.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@
66
"prefer-stable": true,
77
"require": {
88
"php": "~7.0",
9-
"phpstan/phpstan": "dev-dev#19c97e3f31",
9+
"phpstan/phpstan": "dev-dev#a5db1f45ed",
1010
"nette/utils": "^2.3.0"
1111
},
12+
"require-dev": {
13+
"consistence/coding-standard": "~0.11.0",
14+
"phing/phing": "^2.13.0",
15+
"phpunit/phpunit": "^5.3",
16+
"slevomat/coding-standard": "dev-php7#961090ac32"
17+
},
1218
"autoload": {
1319
"psr-4": {
1420
"PHPStan\\": "src/"
1521
}
22+
},
23+
"autoload-dev": {
24+
"classmap": ["tests/"]
1625
}
1726
}

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
parameters:
2+
ignoreErrors:
3+
- '#Call to an undefined method PHPUnit_Framework_MockObject_MockObject::[a-zA-Z0-9_]+\(\)#'

ruleset.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPStan Nette class reflection extension">
3+
<rule ref="vendor/consistence/coding-standard/Consistence/ruleset.xml"/>
4+
<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml">
5+
<exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName"/>
6+
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
7+
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
8+
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
9+
</rule>
10+
<rule ref="SlevomatCodingStandard.Typehints.TypeHintDeclaration">
11+
<properties>
12+
<property name="usefulAnnotations" type="array" value="
13+
@dataProvider
14+
"/>
15+
</properties>
16+
</rule>
17+
</ruleset>

src/Reflection/Nette/HtmlClassReflectionExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types=1);
1+
<?php declare(strict_types = 1);
22

33
namespace PHPStan\Reflection\Nette;
44

@@ -32,5 +32,4 @@ public function getProperty(ClassReflection $classReflection, string $propertyNa
3232
return new HtmlPropertyReflection($classReflection);
3333
}
3434

35-
3635
}

src/Reflection/Nette/HtmlMethodReflection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types=1);
1+
<?php declare(strict_types = 1);
22

33
namespace PHPStan\Reflection\Nette;
44

@@ -13,7 +13,7 @@ class HtmlMethodReflection implements MethodReflection
1313

1414
/** @var string */
1515
private $name;
16-
16+
1717
/** @var \PHPStan\Reflection\ClassReflection */
1818
private $declaringClass;
1919

src/Reflection/Nette/HtmlPropertyReflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types=1);
1+
<?php declare(strict_types = 1);
22

33
namespace PHPStan\Reflection\Nette;
44

src/Reflection/Nette/NetteObjectClassReflectionExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types=1);
1+
<?php declare(strict_types = 1);
22

33
namespace PHPStan\Reflection\Nette;
44

@@ -82,4 +82,5 @@ private function getTraitNames(\ReflectionClass $class): array
8282

8383
return $traitNames;
8484
}
85+
8586
}

src/Reflection/Nette/NetteObjectEventListenerMethodReflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types=1);
1+
<?php declare(strict_types = 1);
22

33
namespace PHPStan\Reflection\Nette;
44

0 commit comments

Comments
 (0)