Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
ARG PHP_VERSION=8.2
ARG PHPUNIT_VERSION=10.4.0
ARG PHPSTAN_VERSION=1.10.38
ARG PHP_VERSION=8.5

FROM php:${PHP_VERSION}-cli-alpine
COPY --from=composer /usr/bin/composer /usr/bin/composer

ARG PHPUNIT_VERSION
ARG PHPSTAN_VERSION

RUN docker-php-ext-install bcmath && docker-php-ext-enable bcmath
RUN wget -O phpunit https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar && chmod +x phpunit
RUN wget -O phpstan https://github.com/phpstan/phpstan/releases/download/${PHPSTAN_VERSION}/phpstan.phar && chmod +x phpstan

4 changes: 1 addition & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
PHP_VERSION=8.2
PHPUNIT_VERSION=10.4.0
PHPSTAN_VERSION=1.10.38
PHP_VERSION=8.5
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:

jobs:
testsuite:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.3', '8.5']
php-version: ['8.2', '8.3', '8.4', '8.5']

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -32,29 +32,29 @@ jobs:

- name: Run PHPUnit
run: |
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
if [[ ${{ matrix.php-version }} == '8.2' ]]; then
vendor/bin/phpunit --coverage-clover=coverage.xml
else
vendor/bin/phpunit
fi

- name: Code Coverage Report
if: success() && matrix.php-version == '8.1'
uses: codecov/codecov-action@v4
if: success() && matrix.php-version == '8.2'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

validation:
name: Coding Standard & Static Analysis
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: mbstring, intl, bcmath
coverage: none

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![CI](https://github.com/php-collective/decimal-object/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/php-collective/decimal-object/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/php-collective/decimal-object/branch/master/graph/badge.svg?token=L1thFB9nOG)](https://codecov.io/gh/php-collective/decimal-object)
[![Latest Stable Version](https://poser.pugx.org/php-collective/decimal-object/v/stable.svg)](https://packagist.org/packages/php-collective/decimal-object)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.2-8892BF.svg)](https://php.net/)
[![PHPStan](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg?style=flat)](https://phpstan.org/)
[![License](https://poser.pugx.org/php-collective/decimal-object/license)](https://packagist.org/packages/php-collective/decimal-object)

Expand All @@ -26,7 +26,7 @@ Monetary values themselves could be handled also with [brick/money](https://gith

For details see the [wiki](https://github.com/php-collective/decimal-object/wiki).

Note: If you are looking for pre PHP 8.1 versions, check out the [legacy library](https://github.com/spryker/decimal-object).
Note: PHP 8.1 is covered by the 1.3 releases. For anything older, check out the [legacy library](https://github.com/spryker/decimal-object).

## Features

Expand All @@ -40,6 +40,7 @@ Note: If you are looking for pre PHP 8.1 versions, check out the [legacy library

### Requirements

- PHP 8.2+
- `bcmath` PHP extension enabled

### Composer (preferred)
Expand Down
4 changes: 1 addition & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ services:
context: .
dockerfile: .docker/Dockerfile
args:
PHP_VERSION: "${PHP_VERSION:-8.2}"
PHPUNIT_VERSION: "${PHPUNIT_VERSION:-10.4.0}"
PHPSTAN_VERSION: "${PHPSTAN_VERSION:-1.10.38}"
PHP_VERSION: "${PHP_VERSION:-8.5}"
volumes:
- ./:/code
working_dir: /code
18 changes: 15 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"description": "PHP decimal handling as value object",
"license": "MIT",
"type": "library",
"keywords": [
"decimal",
"value-object",
"bcmath",
"precision",
"arbitrary-precision",
"math"
],
"authors": [
{
"name": "The PHP Collective",
Expand All @@ -13,15 +21,19 @@
"homepage": "https://spryker.com"
}
],
"support": {
"issues": "https://github.com/php-collective/decimal-object/issues",
"source": "https://github.com/php-collective/decimal-object"
},
"require": {
"php": ">=8.1",
"php": ">=8.2",
"ext-bcmath": "*",
"ext-json": "*"
},
"require-dev": {
"php-collective/code-sniffer": "^0.2.1",
"php-collective/code-sniffer": "^0.6.8",
"phpstan/phpstan": "^2.0.0",
"phpunit/phpunit": "^10.5.45 || ^11.0.0 || ^12.0.0 || ^13.0.0"
"phpunit/phpunit": "^11.5.0 || ^12.0.0 || ^13.0.0"
},
"minimum-stability": "stable",
"prefer-stable": true,
Expand Down
2 changes: 2 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
>
Expand Down
Loading
Loading