Skip to content

Commit

Permalink
Moved error_reporting setting from CI to PHPUnit config so all builds…
Browse files Browse the repository at this point in the history
… (including local) are affected.

Fixed build link and image in Readme.
  • Loading branch information
Bilge committed Dec 14, 2022
1 parent aa943ef commit b89895b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 25 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/CI.yml → .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Tests

on:
push:
Expand All @@ -14,29 +14,28 @@ jobs:
fail-fast: false
matrix:
php:
- 8.2
- 8.1
- 8.0
- 8.1
- 8.2
dependencies:
- hi
- lo

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
ini-values: error_reporting=-1

- name: Validate composer.json
run: composer validate

- name: Cache dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: php-${{ matrix.php }}-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.*/
!/.github/
/vendor/
/composer.lock
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@ ByteFormatter formats byte values as human-readable strings. An appropriate expo
that the value never exceeds the base. For example, in base 1024, `format(1023)` gives *1023 B* but `format(1024)` gives
*1 KiB* instead of *1024 B*.

Requirements
------------

- [PHP 5.5](http://php.net/)
- [Composer](https://getcomposer.org/)

Usage
-----

By default bytes are divided using `Base::BINARY` into multiples of 1024.
By default, bytes are divided using `Base::BINARY` into multiples of 1024.

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

By default all values are rounded to the nearest integer.
By default, all values are rounded to the nearest integer.

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

| Exponent | Symbol |
|:--------:|:------:|
| 0 | B |
| 1 | K |
| 2 | M |
| 3 | G |
| 4 | T |
| 5 | P |
| 6 | E |
| 7 | Z |
| 8 | Y |
| 0 | B |
| 1 | K |
| 2 | M |
| 3 | G |
| 4 | T |
| 5 | P |
| 6 | E |
| 7 | Z |
| 8 | Y |

Unit customization
------------------
Expand Down Expand Up @@ -199,8 +193,8 @@ in this document can be found in `DocumentationTest`.
[Version image]: https://poser.pugx.org/scriptfusion/byte-formatter/version "Latest version"
[Downloads]: https://packagist.org/packages/scriptfusion/byte-formatter
[Downloads image]: https://poser.pugx.org/scriptfusion/byte-formatter/downloads "Total downloads"
[Build]: http://travis-ci.org/ScriptFUSION/Porter
[Build image]: https://travis-ci.org/ScriptFUSION/ByteFormatter.svg?branch=master "Build status"
[Build]: https://github.com/ScriptFUSION/ByteFormatter/actions/workflows/Tests.yaml
[Build image]: https://github.com/ScriptFUSION/ByteFormatter/actions/workflows/Tests.yaml/badge.svg "Build status"
[Coverage]: https://coveralls.io/github/ScriptFUSION/ByteFormatter
[Coverage image]: https://coveralls.io/repos/ScriptFUSION/ByteFormatter/badge.svg "Test coverage"
[Style]: https://styleci.io/repos/18541340
Expand Down
5 changes: 5 additions & 0 deletions test/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<phpunit
beStrictAboutOutputDuringTests="true"
>
<php>
<ini name="error_reporting" value="-1"/>
</php>

<testsuite name="all">
<directory>.</directory>
</testsuite>

<coverage processUncoveredFiles="true">
<include>
<directory>../src</directory>
Expand Down

0 comments on commit b89895b

Please sign in to comment.