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
2 changes: 1 addition & 1 deletion .github/workflows/code_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
include:
- php: '8.2'
- php: '8.5'
Comment thread
johanib marked this conversation as resolved.
stability: prefer-stable

name: PHP ${{ matrix.php }} tests - ${{ matrix.stability }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.5
coverage: pcov

# Implicitly runs `composer tests` in post update cmd. So PHPCS, MD and other static analysis is executed at
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests-upcoming-symfony.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ jobs:
uses: shivammathur/setup-php@2.22.0
with:
coverage: none
php-version: '8.2'
php-version: '8.5'
tools: composer:v2
extensions: mbstring
ini-values: date.timezone=UTC

- name: 'Install project dependencies'
env:
SYMFONY_REQUIRE: '6.4.x@dev'
SYMFONY_REQUIRE: '8.*'
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins symfony/flex
composer config minimum-stability dev
composer config prefer-stable false
composer update --no-interaction --optimize-autoloader
composer require symfony/phpunit-bridge
composer update --no-interaction --optimize-autoloader --no-scripts
composer require --no-scripts symfony/phpunit-bridge

- name: 'Run tests'
env:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
# Unreleased
- Raise the Composer platform to PHP 8.5.
- Update the code checks, code coverage and upcoming Symfony workflows to run on PHP 8.5.

# 4.0.0
- Drop SF4 support, Allow SF7.
- Raise minimum PHP requirement to 8.2
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpmd/phpmd": "^2.13",
"phpunit/phpunit": "^9.6|^10.4",
"rector/rector": "^2.4",
"sebastian/phpcpd": "^4.1|^5.0|^6.0",
"squizlabs/php_codesniffer": "^3.6",
"malukenho/docheader": "^1.0",
Expand All @@ -38,15 +39,17 @@
"phpcs": "vendor/bin/phpcs src tests --report=full --standard=phpcs.xml --extensions=php --warning-severity=0",
"phpcpd": "vendor/bin/phpcpd src",
"phpunit": "vendor/bin/phpunit --coverage-text",
"phpmd": "vendor/bin/phpmd src text phpmd.xml"
"phpmd": "@php -d \"error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED\" vendor/bin/phpmd src text phpmd.xml"
},
"rector": "vendor/bin/rector process --dry-run",
"rector-fix": "vendor/bin/rector process",
"post-update-cmd": [
"@tests"
]
},
"config": {
"platform": {
"php": "8.2"
"php": "8.5"
},
"preferred-install": {
"*": "dist"
Expand Down
14 changes: 14 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;

return RectorConfig::configure()
->withPaths([__DIR__.'/config', __DIR__.'/src', __DIR__.'/tests'])
->withPhpSets()
->withComposerBased(doctrine: true, symfony: true, phpunit: true)
->withAttributesSets(doctrine: true, symfony: true, phpunit: true)
->withSkip([
\Rector\Php84\Rector\MethodCall\NewMethodCallWithoutParenthesesRector::class,
]);
2 changes: 1 addition & 1 deletion src/HealthCheck/SessionHealthCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function check(HealthReportInterface $report): HealthReportInterface
if ($sessionStatus !== PHP_SESSION_DISABLED && $sessionStatus === PHP_SESSION_NONE) {
try {
session_start();
} catch (Exception $e) {
} catch (Exception) {
return HealthReport::buildStatusDown('Session support is enabled but no session could be started.');
}
// Destroy the session
Expand Down
23 changes: 4 additions & 19 deletions src/Value/HealthReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,6 @@
*/
class HealthReport implements HealthReportInterface, JsonSerializable
{
/**
* @var string
*/
private $status;

/**
* @var int
*/
private $code;

/**
* @var string
*/
private $message = '';

public static function buildStatusUp(): HealthReportInterface
{
return new self(HealthReportInterface::STATUS_UP, HealthReportInterface::STATUS_CODE_UP);
Expand All @@ -51,11 +36,11 @@ public static function buildStatusDown($message = ''): HealthReportInterface
return new self(HealthReportInterface::STATUS_DOWN, HealthReportInterface::STATUS_CODE_DOWN, $message);
}

private function __construct(string $status, $code, string $message = '')
/**
* @param int $code
*/
private function __construct(private readonly string $status, private $code, private readonly string $message = '')
{
$this->status = $status;
$this->code = $code;
$this->message = $message;
}

public function isDown(): bool
Expand Down
Loading