Skip to content

Commit

Permalink
Merge branch '4.x' into from-string-string-method
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Apr 27, 2024
2 parents 57b23bd + 3caf795 commit 4df6a88
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 29 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -36,7 +36,7 @@ jobs:
coverage: "none"

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"

- name: "Check syntax (php-parallel-lint)"
run: "composer lint -- --colors"
Expand All @@ -58,7 +58,7 @@ jobs:
coverage: "none"

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"

- name: "Statically analyze code (PHPStan)"
run: "composer phpstan -- --ansi"
Expand All @@ -79,6 +79,12 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
include:
# Keep the locked version by default
- dependency-versions: "locked"
# For PHP 8.0, installing with --prefer-highest to use brick/math v0.11
- php-version: "8.0"
dependency-versions: "highest"

steps:
- name: "Checkout repository"
Expand All @@ -98,7 +104,9 @@ jobs:
ini-values: "memory_limit=-1"

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependency-versions }}"

- name: "Run PHPBench"
run: "composer phpbench -- --ansi"
Expand All @@ -125,15 +133,15 @@ jobs:
ini-values: "memory_limit=-1"

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run unit tests (PHPUnit)"
run: "./vendor/bin/phpunit --verbose --colors=always --coverage-text --coverage-clover build/logs/clover.xml"

- name: "Publish coverage report to Codecov"
uses: "codecov/codecov-action@v4.0.1"
uses: "codecov/codecov-action@v4.3.0"

unit-tests:
name: "Unit Tests"
Expand All @@ -151,6 +159,12 @@ jobs:
operating-system:
- "ubuntu-latest"
- "windows-latest"
include:
# Keep the locked version by default
- dependency-versions: "locked"
# For PHP 8.0, installing with --prefer-highest to use brick/math v0.11
- php-version: "8.0"
dependency-versions: "highest"

steps:
- name: "Configure Git (for Windows)"
Expand All @@ -177,9 +191,9 @@ jobs:
ini-values: "memory_limit=-1"

- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "${{ matrix.composer-options }}"
dependency-versions: "${{ matrix.dependency-versions }}"

- name: "Run unit tests (PHPUnit)"
run: "./vendor/bin/phpunit --verbose --colors=always --no-coverage"
2 changes: 1 addition & 1 deletion .github/workflows/merge-dependabot-upgrades.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Auto-Merge
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ridedott/merge-me-action@v2.10.67
uses: ridedott/merge-me-action@v2.10.77
with:
# This must be used as GitHub Actions token does not support pushing
# to protected branches.
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
@@ -1,9 +1,9 @@
version: 2

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.7"
python: "3.12"

sphinx:
configuration: docs/conf.py
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -11,7 +11,7 @@
"require": {
"php": "^8.0",
"ext-json": "*",
"brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11",
"brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12",
"ramsey/collection": "^1.2 || ^2.0"
},
"require-dev": {
Expand Down
29 changes: 17 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/requirements.txt
@@ -1,3 +1,3 @@
Sphinx==2.4.3
sphinx-rtd-theme==0.4.3
sphinxcontrib-phpdomain==0.7.0
Sphinx==7.3.7
sphinx-rtd-theme==2.0.0
sphinxcontrib-phpdomain==0.11.1
3 changes: 2 additions & 1 deletion psalm.xml
Expand Up @@ -4,7 +4,8 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorLevel="1"
cacheDirectory="./build/cache/psalm"
errorBaseline="psalm-baseline.xml">
errorBaseline="psalm-baseline.xml"
phpVersion="8.1">

<projectFiles>
<directory name="./src" />
Expand Down
6 changes: 4 additions & 2 deletions src/Math/BrickMathCalculator.php
Expand Up @@ -136,9 +136,11 @@ public function toInteger(Hexadecimal $value): IntegerObject

/**
* Maps ramsey/uuid rounding modes to those used by brick/math
*
* @return BrickMathRounding::*
*/
private function getBrickRoundingMode(int $roundingMode): int
private function getBrickRoundingMode(int $roundingMode)
{
return self::ROUNDING_MODE_MAP[$roundingMode] ?? 0;
return self::ROUNDING_MODE_MAP[$roundingMode] ?? BrickMathRounding::UNNECESSARY;
}
}

0 comments on commit 4df6a88

Please sign in to comment.