Skip to content

Commit b89895b

Browse files
committedDec 14, 2022
Moved error_reporting setting from CI to PHPUnit config so all builds (including local) are affected.
Fixed build link and image in Readme.
1 parent aa943ef commit b89895b

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
lines changed
 

‎.github/workflows/CI.yml renamed to ‎.github/workflows/Tests.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Tests
22

33
on:
44
push:
@@ -14,29 +14,28 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
php:
17-
- 8.2
18-
- 8.1
1917
- 8.0
18+
- 8.1
19+
- 8.2
2020
dependencies:
2121
- hi
2222
- lo
2323

2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2626

2727
- name: Setup PHP ${{ matrix.php }}
2828
uses: shivammathur/setup-php@v2
2929
with:
3030
php-version: ${{ matrix.php }}
3131
coverage: xdebug
32-
ini-values: error_reporting=-1
3332

3433
- name: Validate composer.json
3534
run: composer validate
3635

3736
- name: Cache dependencies
3837
id: composer-cache
39-
uses: actions/cache@v2
38+
uses: actions/cache@v3
4039
with:
4140
path: vendor
4241
key: php-${{ matrix.php }}-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/.*/
2+
!/.github/
23
/vendor/
34
/composer.lock

‎README.md

+13-19
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,10 @@ ByteFormatter formats byte values as human-readable strings. An appropriate expo
1111
that the value never exceeds the base. For example, in base 1024, `format(1023)` gives *1023 B* but `format(1024)` gives
1212
*1 KiB* instead of *1024 B*.
1313

14-
Requirements
15-
------------
16-
17-
- [PHP 5.5](http://php.net/)
18-
- [Composer](https://getcomposer.org/)
19-
2014
Usage
2115
-----
2216

23-
By default bytes are divided using `Base::BINARY` into multiples of 1024.
17+
By default, bytes are divided using `Base::BINARY` into multiples of 1024.
2418

2519
```php
2620
(new ByteFormatter)->format(0x80000);
@@ -37,7 +31,7 @@ Bytes can be divided into multiples of 1000 by specifying `Base::DECIMAL` as the
3731
Precision
3832
---------
3933

40-
By default all values are rounded to the nearest integer.
34+
By default, all values are rounded to the nearest integer.
4135

4236
```php
4337
(new ByteFormatter)->format(0x80233);
@@ -101,15 +95,15 @@ always be in `KiB`. Consult the following table to see how exponents map to symb
10195

10296
| Exponent | Symbol |
10397
|:--------:|:------:|
104-
| 0 | B |
105-
| 1 | K |
106-
| 2 | M |
107-
| 3 | G |
108-
| 4 | T |
109-
| 5 | P |
110-
| 6 | E |
111-
| 7 | Z |
112-
| 8 | Y |
98+
| 0 | B |
99+
| 1 | K |
100+
| 2 | M |
101+
| 3 | G |
102+
| 4 | T |
103+
| 5 | P |
104+
| 6 | E |
105+
| 7 | Z |
106+
| 8 | Y |
113107

114108
Unit customization
115109
------------------
@@ -199,8 +193,8 @@ in this document can be found in `DocumentationTest`.
199193
[Version image]: https://poser.pugx.org/scriptfusion/byte-formatter/version "Latest version"
200194
[Downloads]: https://packagist.org/packages/scriptfusion/byte-formatter
201195
[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"
196+
[Build]: https://github.com/ScriptFUSION/ByteFormatter/actions/workflows/Tests.yaml
197+
[Build image]: https://github.com/ScriptFUSION/ByteFormatter/actions/workflows/Tests.yaml/badge.svg "Build status"
204198
[Coverage]: https://coveralls.io/github/ScriptFUSION/ByteFormatter
205199
[Coverage image]: https://coveralls.io/repos/ScriptFUSION/ByteFormatter/badge.svg "Test coverage"
206200
[Style]: https://styleci.io/repos/18541340

‎test/phpunit.xml

+5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<phpunit
22
beStrictAboutOutputDuringTests="true"
33
>
4+
<php>
5+
<ini name="error_reporting" value="-1"/>
6+
</php>
7+
48
<testsuite name="all">
59
<directory>.</directory>
610
</testsuite>
11+
712
<coverage processUncoveredFiles="true">
813
<include>
914
<directory>../src</directory>

0 commit comments

Comments
 (0)
Please sign in to comment.