Skip to content

Commit 5310f34

Browse files
committed
Updated readme and Travis build.
Added code coverage. Fixed PSR-2 violations.
1 parent 8ef73d3 commit 5310f34

File tree

10 files changed

+66
-1194
lines changed

10 files changed

+66
-1194
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/.*/
22
/vendor/
3+
/composer.lock

.travis.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,31 @@ php:
66
- 5.5
77
- 5.6
88
- 7.0
9+
- 7.1
910

10-
before_install:
11-
- phpenv config-rm xdebug.ini
11+
env:
12+
matrix:
13+
-
14+
- DEPENDENCIES=--prefer-lowest
15+
16+
matrix:
17+
fast_finish: true
18+
19+
cache:
20+
directories:
21+
- .composer/cache
1222

1323
install:
14-
- composer -n selfupdate
15-
- composer -n --prefer-source install
24+
- alias composer=composer\ -n && composer selfupdate
25+
- composer validate
26+
- composer update $DEPENDENCIES
1627

1728
script:
18-
- vendor/bin/phpunit test
19-
- vendor/bin/phpcs --standard=PSR2 src
29+
- composer test -- --coverage-clover=build/logs/clover.xml
30+
31+
after_success:
32+
- composer require satooshi/php-coveralls
33+
- vendor/bin/coveralls -v
2034

2135
notifications:
2236
email: false

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
ByteFormatter
22
=============
33

4-
[![Version][Version image]][Releases]
4+
[![Latest version][Version image]][Releases]
5+
[![Total downloads][Downloads image]][Downloads]
56
[![Build status][Build image]][Build]
7+
[![Test coverage][Coverage image]][Coverage]
8+
[![Code style][Style image]][Style]
69

710
ByteFormatter formats byte values as human-readable strings. An appropriate exponent is calculated automatically such
811
that the value never exceeds the base. For example, in base 1024, `format(1023)` gives *1023 B* but `format(1024)` gives
@@ -13,7 +16,6 @@ Requirements
1316

1417
- [PHP 5.5](http://php.net/)
1518
- [Composer](https://getcomposer.org/)
16-
- No production dependencies!
1719

1820
Usage
1921
-----
@@ -189,10 +191,17 @@ Using decimal base:
189191
Testing
190192
-------
191193

192-
This library is fully unit tested. Run the tests with `vendor/bin/phpunit test` from the command line. All examples
194+
This library is fully unit tested. Run the tests with `composer test` from the command line. All examples
193195
in this document can be found in `DocumentationTest`.
194196

197+
195198
[Releases]: https://github.com/ScriptFUSION/ByteFormatter/releases
196199
[Version image]: https://poser.pugx.org/scriptfusion/byte-formatter/version "Latest version"
197-
[Build]: http://travis-ci.org/ScriptFUSION/ByteFormatter
198-
[Build image]: http://img.shields.io/travis/ScriptFUSION/ByteFormatter.svg "Build status"
200+
[Downloads]: https://packagist.org/packages/scriptfusion/byte-formatter
201+
[Downloads image]: https://poser.pugx.org/scriptfusion/byte-formatter/downloads "Total downloads"
202+
[Build]: http://travis-ci.org/ScriptFUSION/Porter
203+
[Build image]: https://travis-ci.org/ScriptFUSION/ByteFormatter.svg?branch=master "Build status"
204+
[Coverage]: https://coveralls.io/github/ScriptFUSION/ByteFormatter
205+
[Coverage image]: https://coveralls.io/repos/ScriptFUSION/ByteFormatter/badge.svg "Test coverage"
206+
[Style]: https://styleci.io/repos/18541340
207+
[Style image]: https://styleci.io/repos/18541340/shield?style=flat "Code style"

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
}
1515
},
1616
"require": {
17-
"php": ">=5.5"
17+
"php": "^5.5|^7",
18+
"scriptfusion/static-class": "^1"
1819
},
1920
"require-dev": {
20-
"phpunit/phpunit": "^4",
21-
"mockery/mockery": "^0",
22-
"squizlabs/php_codesniffer": "^2"
21+
"phpunit/phpunit": "^4.8",
22+
"mockery/mockery": "^0.9.4"
23+
},
24+
"scripts": {
25+
"test": "phpunit -c test"
2326
}
2427
}

0 commit comments

Comments
 (0)