Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 #294

Merged
merged 2 commits into from
Jan 10, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["8.0", "8.1", "8.2", "8.3"]
php-versions: ["8.0", "8.1", "8.2", "8.3", "8.4"]
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.3
uses: shivammathur/setup-php@2.32.0
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Test
run: composer test-with-coverage
- name: Upload Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
files: ./clover.xml
verbose: true
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "BSD-3-Clause",
"prefer-stable": true,
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"diablomedia/zendframework1-exception": "^1.1.1",
"diablomedia/zendframework1-config": "^2.0.5",
"diablomedia/zendframework1-loader": "^1.0.5"
Expand All @@ -30,8 +30,8 @@
},
"require-dev": {
"phpunit/phpunit": "^9.6.19 || ^10.5.18",
"phpstan/phpstan": "1.10.67",
"friendsofphp/php-cs-fixer": "3.58.0",
"phpstan/phpstan": "2.1.1",
"friendsofphp/php-cs-fixer": "3.67.0",
"maglnet/composer-require-checker": "^3.0.0",
"phpro/grumphp-shim": "^2.0.0"
},
Expand Down
3 changes: 3 additions & 0 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# grumphp.yml
grumphp:
environment:
variables:
PHP_CS_FIXER_IGNORE_ENV: "true"
tasks:
composer:
strict: true
Expand Down
18 changes: 14 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
level: 8
paths:
- ./
Expand All @@ -9,6 +9,8 @@ parameters:
bootstrapFiles:
- ./phpstan-bootstrap.php
ignoreErrors:
-
identifier: missingType.iterableValue
# call_user_func does accept an array as the callable
-
message: '#Parameter \#1 \$(function|callback) of function call_user_func expects callable\(\): mixed, array{string, .factory.} given\.#'
Expand All @@ -24,9 +26,6 @@ parameters:
path: './src/Zend/Log/Writer/Stream.php'
# All of these are defensive coding in case an object isn't returned from _constructFromConfig (which is
# possible, since it's a call_user_func return)
-
message: '#Else branch is unreachable because ternary operator condition is always true.#'
path: './src/Zend/Log.php'
-
message: '#Parameter \#1 \$(argument|objectOrClass) of class ReflectionClass constructor expects class-string<T of object>\|T of object, string given\.#'
path: ./src/Zend/Log.php
Expand All @@ -35,3 +34,14 @@ parameters:
message: '#Cannot cast array{}\|bool\|float\|int\|object\|string\|null to string\.#'
count: 2
path: ./src/Zend/Log/Formatter/Xml.php
-
message: '#^Cannot access offset ''filterName'' on array\|Zend_Config\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Zend/Log.php

-
message: '#^Cannot access offset ''formatterName'' on array\|Zend_Config\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Zend/Log.php
2 changes: 1 addition & 1 deletion src/Zend/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Zend_Log
*
* @param Zend_Log_Writer_Abstract|null $writer default writer
*/
public function __construct(Zend_Log_Writer_Abstract $writer = null)
public function __construct(Zend_Log_Writer_Abstract|null $writer = null)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PHPDoc line could be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept that one because of the "default writer" comment on the end.

{
$r = new ReflectionClass($this);
$this->_priorities = array_flip($r->getConstants());
Expand Down
1 change: 0 additions & 1 deletion src/Zend/Log/Filter/Suppress.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public function accept($event)
*
* @param array|Zend_Config $config
* @return Zend_Log_Filter_Suppress
* @throws Zend_Log_Exception
*/
public static function factory($config)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Log/LogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function testUsingWithErrorHandler()
$oldErrorLevel = error_reporting();

$this->expectingLogging = true;
error_reporting(E_ALL | E_STRICT);
error_reporting(E_ALL);

$oldHandler = set_error_handler(array($this, 'verifyHandlerData'));
$logger->registerErrorHandler();
Expand Down
Loading