File tree Expand file tree Collapse file tree 5 files changed +111
-0
lines changed Expand file tree Collapse file tree 5 files changed +111
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Composer lock file
2
+ /composer.lock
3
+
4
+ # 3rd party libs
5
+ /vendor
6
+
7
+ # Test results
8
+ /test-results
Original file line number Diff line number Diff line change
1
+ # PHP Reflection Utils
2
+ A small helper class to make accessing private properties and methods easier, largely used in testing.
3
+
4
+ [ ![ Build Status] (https://ci.jacekk.co.uk/buildStatus/icon?job=PHP Reflection Utils)] (https://ci.jacekk.co.uk/job/PHP Reflection Utils)
5
+
6
+ ## Installation
7
+ The library can be included via composer by adding a custom repo and the project name
8
+ ~~~ json
9
+ {
10
+ "repositories" : [
11
+ {
12
+ "type" : " vcs" ,
13
+ "url" : " https://github.com/betterphp/php-reflection-utils.git"
14
+ }
15
+ ],
16
+ "require-dev" : {
17
+ "betterphp/php-reflection-utils" : " dev-master"
18
+ }
19
+ }
20
+ ~~~
21
+ This will pull from the master branch whenever you run ` composer update ` , proper versioning is on the to-do list.
22
+
23
+ ## Testing
24
+ We use phpcs and phpunit for testing, run both before commiting anything
25
+ ~~~
26
+ ./vendor/bin/phpcs -p --standard=./ruleset.xml .
27
+ ~~~
28
+ ~~~
29
+ ./vendor/bin/phpunit -c ./phpunit.xml
30
+ ~~~
31
+
32
+ phpunit will do code coverage checking which requires xdebug, if it's not installed this will fail gracefully - not to worry.
33
+
34
+ A report of the test coverage is published [ here by Jenkins] (https://ci.jacekk.co.uk/job/PHP Reflection Utils/HTML_Code_Coverage/index.html)
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " betterphp/php-reflection-utils" ,
3
+ "version" : " 0.1-dev" ,
4
+ "repositories" : [
5
+ {
6
+ "type" : " vcs" ,
7
+ "url" : " https://github.com/betterphp/php-code-style.git"
8
+ }
9
+ ],
10
+ "require-dev" : {
11
+ "betterphp/php-code-style" : " dev-master" ,
12
+ "squizlabs/php_codesniffer" : " ~2" ,
13
+ "phpunit/phpunit" : " ~5"
14
+ },
15
+ "autoload" : {
16
+ "psr-4" : {
17
+ "betterphp\\ reflection_utils\\ " : " ."
18
+ }
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ <phpunit bootstrap =" vendor/autoload.php" colors =" true" >
2
+ <testsuites >
3
+ <testsuite name =" PHP Reflection Utils" >
4
+ <directory >tests</directory >
5
+ </testsuite >
6
+ </testsuites >
7
+
8
+ <filter >
9
+ <whitelist addUncoveredFilesFromWhitelist =" true" processUncoveredFilesFromWhitelist =" false" >
10
+ <directory suffix =" .php" >./</directory >
11
+ <exclude >
12
+ <!-- Not our code -->
13
+ <directory >./vendor</directory >
14
+ <!-- Don't test tests -->
15
+ <directory >./tests</directory >
16
+ <directory >./test-results</directory >
17
+ <!-- Won't contain any php code but take a while to scan -->
18
+ <directory >./.git</directory >
19
+ </exclude >
20
+ </whitelist >
21
+ </filter >
22
+
23
+ <logging >
24
+ <log type =" junit" target =" ./test-results/phpunit-junit.xml" logIncompleteSkipped =" true" />
25
+ <log type =" coverage-clover" target =" ./test-results/phpunit-clover.xml" />
26
+ <log type =" coverage-html" target =" ./test-results/phpunit-html" lowUpperBound =" 35" highLowerBound =" 70" />
27
+ <log type =" coverage-text" target =" php://stdout" showUncoveredFiles =" true" />
28
+ </logging >
29
+ </phpunit >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <ruleset name =" vnstat-frontend-style" >
3
+ <description >PHP Reflection Utils Code Style</description >
4
+ <exclude-pattern type =" relative" >^.git/*</exclude-pattern >
5
+ <exclude-pattern type =" relative" >^vendor/*</exclude-pattern >
6
+ <exclude-pattern type =" relative" >^test-results/*</exclude-pattern >
7
+
8
+ <rule ref =" vendor/betterphp/php-code-style/Standard" />
9
+
10
+ <!-- PHPUnis uses special function comments -->
11
+ <rule ref =" Standard.Commenting.FunctionComment" >
12
+ <exclude-pattern >*/tests/*</exclude-pattern >
13
+ </rule >
14
+
15
+ <!-- Not too bothered about spacing and full stops -->
16
+ <rule ref =" Standard.Commenting.FunctionComment.SpacingAfterParamType" ><severity >0</severity ></rule >
17
+ <rule ref =" Standard.Commenting.FunctionComment.SpacingAfterParamName" ><severity >0</severity ></rule >
18
+ <rule ref =" Standard.Commenting.FunctionComment.ThrowsNoFullStop" ><severity >0</severity ></rule >
19
+ <rule ref =" Standard.Commenting.FunctionComment.ParamCommentFullStop" ><severity >0</severity ></rule >
20
+ </ruleset >
You can’t perform that action at this time.
0 commit comments