Skip to content

Fix PHP 8.5 issues#2996

Merged
dantleech merged 1 commit intophpactor:masterfrom
przepompownia:follow-deps
Apr 18, 2026
Merged

Fix PHP 8.5 issues#2996
dantleech merged 1 commit intophpactor:masterfrom
przepompownia:follow-deps

Conversation

@przepompownia
Copy link
Copy Markdown
Contributor

@przepompownia przepompownia commented Dec 21, 2025

Problem: some phpunit tests fail on PHP 8.5

Solution:

  • upgrade Psalm version
  • increase test Psalm process timeout to 15 s
  • fix new deprecations
  • add 8.5 to CI matrix

Comment thread lib/Extension/ContextMenu/Model/ContextMenu.php
@przepompownia
Copy link
Copy Markdown
Contributor Author

przepompownia commented Dec 21, 2025

Phpactor\WorseReflection\Tests\Inference\SelfTest::testSelf#php-8.4.0-asym-prop-hooks asym-prop-hooks.test reveals null array key, which is an empty parameter name. $parameter->__toString() in that case shows "protected private(get)" (no name) from lib/WorseReflection/Tests/Inference/php-8.4.0-asym-prop-hooks/asym-prop-hooks.test

<?php

class Book
{
    public function __construct(
        public private(set) string $title,
        public protected(set) string $author,
        protected private(get) int $pubYear,
        public string $bar,
    ) {}

    public function methodThatNowWontParse(): void
    {}
}

$book = new Book();
wrAssertType('string',$book->bar);

@dantleech probably I need your help here - feel free to modify this PR if you want. I'm not sure if it can reveal some bug, maybe worth a separate fix.

I didn't analyze two other remaining deprecations yet.

@przepompownia przepompownia force-pushed the follow-deps branch 5 times, most recently from 894b70d to 2df0f42 Compare December 21, 2025 20:36
@przepompownia przepompownia changed the title Fix PHP 8.5 issues Fix PHP 8.5 issues, drop PHP 8.1 support Dec 21, 2025
@przepompownia przepompownia force-pushed the follow-deps branch 2 times, most recently from 125dfca to 395076b Compare December 26, 2025 20:48
@przepompownia przepompownia force-pushed the follow-deps branch 2 times, most recently from 9cc0792 to bf23869 Compare December 27, 2025 22:26
@dantleech
Copy link
Copy Markdown
Collaborator

I'm OK with bumping to 8.2

probably I need your help here

I'm not sure what the issue is - that's a test file? but the tests are passing. It seems the only issue is PHPStan?

@przepompownia
Copy link
Copy Markdown
Contributor Author

2 tests triggered 1 PHP deprecation:

1) .../lib/WorseReflection/Core/Reflection/Collection/ReflectionParameterCollection.php:42
Using null as an array offset is deprecated, use an empty string instead

Triggered by:

* Phpactor\WorseReflection\Tests\Inference\SelfTest::testSelf#php-8.4.0-asym-prop-hooks asym-prop-hooks.test (4 times)
  .../lib/WorseReflection/Tests/Inference/SelfTest.php:19

* Phpactor\WorseReflection\Tests\Integration\Bridge\TolerantParser\Reflection\ReflectionMethodTest::testReflectMethod#It tolerantes and logs method parameters with missing variables parameter
  .../lib/WorseReflection/Tests/Integration/Bridge/TolerantParser/Reflection/ReflectionMethodTest.php:26

@przepompownia przepompownia marked this pull request as ready for review December 28, 2025 11:58
@przepompownia
Copy link
Copy Markdown
Contributor Author

przepompownia commented Dec 28, 2025

Perhaps enumerated values ​​(here for Monolog logging levels) would avoid silencing phpstan reports, but I'm not sure it's worth changing now.

@przepompownia przepompownia changed the title Fix PHP 8.5 issues, drop PHP 8.1 support Fix PHP 8.5 issues Apr 17, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Phpactor Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 6c85bf3 Previous: 77f9ff9 Ratio
ConfigLoaderBench::benchJsonPlainPhp 0.015409863013698887 ms (± 1.91%) 0.007386810176125254 ms (± 3.09%) 2.09

This comment was automatically generated by workflow using github-action-benchmark.

Problem: some phpunit tests fail on PHP 8.5

Solution:
- upgrade Psalm version
- upgrade Monolog (avoid: deprecation on the one side, dependency conflicts on the other side)
- increase test Psalm process timeout to 15 s
- fix new deprecations
- add 8.5 to CI matrix
@dantleech dantleech merged commit 4ad4307 into phpactor:master Apr 18, 2026
12 checks passed
@dantleech
Copy link
Copy Markdown
Collaborator

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants