Skip to content

Commit

Permalink
Preparing for PHP 8.3 (#311)
Browse files Browse the repository at this point in the history
* Preparing for PHP 8.3

* some more packages ready, updating phpstan baselines to remove php 7

* tests pass locally

* fixing phpstan, upgrading php-cs-fixer

* versions
  • Loading branch information
jaydiablo authored Apr 22, 2024
1 parent f341678 commit c1992a3
Show file tree
Hide file tree
Showing 13 changed files with 1,116 additions and 2,175 deletions.
158 changes: 79 additions & 79 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-args }}
services:
mysql:
image: mysql/mysql-server:5.7
env:
MYSQL_DATABASE: zftest
MYSQL_USER: github
MYSQL_PASSWORD: githubpass
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
postgres:
image: postgres:10
env:
POSTGRES_DB: zftest
POSTGRES_USER: github
POSTGRES_PASSWORD: githubpass
ports:
- 5432:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=5
memcached:
image: memcached:latest
ports:
- 11211:11211
# needed because the memcached container does not provide a healthcheck
options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0', '8.1', '8.2']
composer-args: ['', '--prefer-lowest']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@2.26.0
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: pcov
tools: cs2pr
ini-values: session.save_path="/tmp",memory_limit=1024M
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php${{ matrix.php-versions }}-composer-${{ matrix.composer-args }}-${{ hashFiles('**/composer.json') }}
restore-keys: php${{ matrix.php-versions }}-composer-${{ matrix.composer-args }}-
- name: Install Dependencies
run: |
composer update --no-progress --no-suggest --prefer-stable --optimize-autoloader ${{ matrix.composer-args }}
- name: PHPStan
run: composer phpstan
- name: Code Style Check
env:
PHP_CS_FIXER_IGNORE_ENV: true
run: composer style-check -- --format=checkstyle | cs2pr
- name: Test
run: cd tests/ && php runalltests.php --coverage
- name: Merge Coverage
run: ./bin/phpcov merge ./build/coverage --clover=./build/coverage/clover.xml
- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
files: ./build/coverage/clover.xml
build:
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-args }}
services:
mysql:
image: mysql/mysql-server:5.7
env:
MYSQL_DATABASE: zftest
MYSQL_USER: github
MYSQL_PASSWORD: githubpass
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
postgres:
image: postgres:10
env:
POSTGRES_DB: zftest
POSTGRES_USER: github
POSTGRES_PASSWORD: githubpass
ports:
- 5432:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=5
memcached:
image: memcached:latest
ports:
- 11211:11211
# needed because the memcached container does not provide a healthcheck
options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["8.0", "8.1", "8.2", "8.3"]
composer-args: ["", "--prefer-lowest"]
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@2.30.2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: pcov
tools: cs2pr
ini-values: session.save_path="/tmp",memory_limit=1024M
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php${{ matrix.php-versions }}-composer-${{ matrix.composer-args }}-${{ hashFiles('**/composer.json') }}
restore-keys: php${{ matrix.php-versions }}-composer-${{ matrix.composer-args }}-
- name: Install Dependencies
run: |
composer update --no-progress --no-suggest --prefer-stable --optimize-autoloader ${{ matrix.composer-args }}
- name: PHPStan
run: composer phpstan
- name: Code Style Check
env:
PHP_CS_FIXER_IGNORE_ENV: true
run: composer style-check -- --format=checkstyle | cs2pr
- name: Test
run: cd tests/ && php runalltests.php --coverage
- name: Merge Coverage
run: ./bin/phpcov merge ./build/coverage --clover=./build/coverage/clover.xml
- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
files: ./build/coverage/clover.xml
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"diablomedia/zendframework1-crypt": "^1.0.5",
"diablomedia/zendframework1-currency": "^1.0.4",
"diablomedia/zendframework1-date": "^1.0.5",
"diablomedia/zendframework1-db": "^1.0.4",
"diablomedia/zendframework1-db": "^1.0.5",
"diablomedia/zendframework1-dojo": "^1.0.5",
"diablomedia/zendframework1-dom": "^1.0.5",
"diablomedia/zendframework1-eventmanager": "^1.0.5",
Expand Down Expand Up @@ -84,7 +84,7 @@
"diablomedia/zendframework1-view-helper-url": "^1.0.4",
"diablomedia/zendframework1-wildfire": "^1.0.4",
"diablomedia/zendframework1-xml": "^1.0.5",
"php": "^7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0"
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0"
},
"autoload": {
"psr-0": {
Expand Down Expand Up @@ -156,7 +156,7 @@
"phpunit/phpunit": "^9.5.10",
"phpunit/phpcov": "^8.0",
"phpstan/phpstan": "1.10.14",
"friendsofphp/php-cs-fixer": "3.22.0"
"friendsofphp/php-cs-fixer": "3.54.0"
},
"archive": {
"exclude": [
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Barcode/Renderer/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,9 @@ protected function _drawText($text, $size, $position, $font, $color, $alignment
$this->_resource,
$size,
$orientation,
$position[0] - ($width * cos(pi() * $orientation / 180)),
$position[1] + ($width * sin(pi() * $orientation / 180)),
$allocatedColor,
(int) ($position[0] - ($width * cos(pi() * $orientation / 180))),
(int) ($position[1] + ($width * sin(pi() * $orientation / 180))),
(int) $allocatedColor,
$font,
$text
);
Expand Down
Loading

0 comments on commit c1992a3

Please sign in to comment.