Skip to content

Conversation

@bnf
Copy link
Member

@bnf bnf commented Nov 13, 2024

symfony/type-info is currently not compatible to phpstan/phpdoc-parser 2.x which results in a PHP error in extbase modules as shown in https://forge.typo3.org/issues/105582. A fix has been merged upstream, but has not been released yet and it seems there will be no immediate hotfix release by symfony – that means it will only be released by the end of the month [2]).

Explanation of the issue:

phpdocumentor/reflection-docblock 5.6.0 [1] was released yesterday which allows composer install and composer update to raise phpstan/phpdoc-parser to 2.x.

Since symfony/type-info has an optional dependency to phpstan/phpdoc-parser, a conflict is used to express the supported version. This upstream conflict has a weak range [3] as it only forbids incompatible old versions, but not new upcoming major(!) versions.
The statement "conflict": "<1.0"[3] forbids to install any version before 1.0, but missed to opt out from future major releases (which are allowed to be breaking per semver).

Now that phpstan/phpdoc-parser 2.x has been released and is allowed to be installed by other dependencies like
phpdocumentor/reflection-docblock (which is perfectly fine), this range flaw got revealed.

This workaround will be removed once symfony/type-info has been updated to allow an upgrade to phpstan/phpdoc-parser. For that reason this conflict is only added to this composer-only package to avoid a comlete TYPO3 release and is not added to extbase (extbase is not incompatible, symfony/type-info is).

[1] https://github.com/phpDocumentor/ReflectionDocBlock/releases/tag/5.6.0
[2] symfony/symfony#58800 (comment)
[3] https://github.com/symfony/type-info/blob/v7.1.6/composer.json#L36-L37
[4] symfony/symfony#58800 (comment)

@bnf
Copy link
Member Author

bnf commented Nov 13, 2024

Tested (by installing as a local package repository and faking to be version 3.1.2):

composer update "typo3/cms-*" -W 
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 2 updates, 0 removals
  - Downgrading phpstan/phpdoc-parser (2.0.0 => 1.33.0)
  - Upgrading typo3/cms-cli (3.1.1 => 3.1.2)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
  - Removing typo3/cms-cli (3.1.1)
  - Downgrading phpstan/phpdoc-parser (2.0.0 => 1.33.0): Extracting archive
 0/2 [>---------------------------]   0%  - Installing typo3/cms-cli (3.1.2): Symlinking from ../cms-cli

Successfully downgrades even instances that have been updated to phpstan/phpdoc-parser 2.x.

`symfony/type-info` is currently not compatible to
`phpstan/phpdoc-parser` 2.x which results in a PHP error in extbase
modules as shown in https://forge.typo3.org/issues/105582.
A fix has been merged upstream, but has not been released yet and
it seems there will be no immediate hotfix release by symfony – that
means it will only be released by the end of the month [2]).

Explanation of the issue:

`phpdocumentor/reflection-docblock` 5.6.0 [1] was released yesterday
which allows `composer install` and `composer update` to raise
`phpstan/phpdoc-parser` to 2.x.

Since symfony/type-info has an optional dependency to
`phpstan/phpdoc-parser`, a conflict is used to express the
supported version. This upstream conflict has a weak range [3]
as it only forbids incompatible old versions, but not new upcoming
*major*(!) versions.
The statement `"conflict": "<1.0"`[3] forbids to install any
version before 1.0, but missed to opt out from future major releases
(which are allowed to be breaking per semver).

Now that `phpstan/phpdoc-parser` 2.x has been released and is allowed
to be installed by other dependencies like
`phpdocumentor/reflection-docblock` (which is perfectly fine), this
range flaw got revealed.

This workaround will be removed once `symfony/type-info` has been
updated to allow an upgrade to `phpstan/phpdoc-parser`. For that
reason this conflict is only added to this composer-only package
to avoid a comlete TYPO3 release and is not added to extbase
(extbase is not incompatible, `symfony/type-info` is).

[1] https://github.com/phpDocumentor/ReflectionDocBlock/releases/tag/5.6.0
[2] symfony/symfony#58800 (comment)
[3] https://github.com/symfony/type-info/blob/v7.1.6/composer.json#L36-L37
[4] symfony/symfony#58800 (comment)
@bnf bnf force-pushed the symfony-typeinfo-workaround branch from 26b168b to c89a245 Compare November 13, 2024 06:10
@bmack bmack merged commit e7ad171 into TYPO3:main Nov 13, 2024
@AstritA
Copy link

AstritA commented Nov 22, 2025

Hi,

I have a question about the phpstan/phpdoc-parser conflict in typo3/cms-cli and whether it is still needed in its current form.

Environment

  • PHP: 8.3.27 (CLI)
  • Composer: 2.9.2
  • TYPO3: 13.4.20
  • typo3/cms-cli: 3.1.2
  • phpstan/phpdoc-parser: 1.33.0

Relevant Composer output:

composer show typo3/cms-cli --all
  -> conflicts: phpstan/phpdoc-parser <1.0 || >=2.0

composer why phpstan/phpdoc-parser
  - phpdocumentor/reflection-docblock 5.6.4  requires  phpstan/phpdoc-parser (^1.7|^2.0)  
  - phpdocumentor/type-resolver       1.11.1 requires  phpstan/phpdoc-parser (^1.18|^2.0)
  - symfony/type-info                 v7.3.5 conflicts phpstan/phpdoc-parser (<1.30)
  - typo3/cms-cli                     3.1.2  conflicts phpstan/phpdoc-parser (<1.0 || >=2.0)

Background

As far as I understand, the conflict was introduced as a workaround for the Symfony type-info / property-info incompatibility with phpstan/phpdoc-parser 2.0, which caused runtime errors in TYPO3 (Forge issue #105582, “Too few arguments to function PHPStan\PhpDocParser\Lexer\Lexer::__construct() …”). The recommended hotfix was to downgrade phpstan/phpdoc-parser to 1.x (e.g. 1.33.0), which is what my project is currently using.

In the meantime, Symfony seems to have adjusted their constraints:

  • symfony/type-info now declares conflict: phpstan/phpdoc-parser <1.30 and uses phpstan/phpdoc-parser ^1.30|^2.0 in require-dev.
  • symfony/property-info and symfony/serializer also allow phpstan/phpdoc-parser ^1.0|^2.0.
  • New Symfony AI components, such as symfony/ai-platform (and therefore symfony/ai-store), require phpstan/phpdoc-parser ^2.1 and symfony/type-info ^7.3|^8.0.

This means the original Symfony-side incompatibility appears to be fixed, while the TYPO3-side workaround in cms-cli is still preventing projects from using tools that depend on phpstan/phpdoc-parser ^2.x.

Concrete problem

In a TYPO3 13.4.20 project with the setup above, trying to install Symfony AI components fails because of the cms-cli conflict:

composer require symfony/ai-platform -W

Results in (excerpt):

symfony/ai-platform dev-main requires phpstan/phpdoc-parser ^2.1
typo3/cms-cli 3.1.2 conflicts with phpstan/phpdoc-parser 2.3.0
typo3/cms-core v13.4.20 requires typo3/cms-cli ^3.1.1 -> satisfiable by typo3/cms-cli[3.1.2]

So at the moment, installing symfony/ai-platform / symfony/ai-store in a TYPO3 project is blocked by the cms-cli conflict.

Question

Is the broad conflict

"conflict": {
    "phpstan/phpdoc-parser": "<1.0 || >=2.0"
}

still required now that Symfony’s type-info / property-info stack supports phpstan/phpdoc-parser 2.x?

If there is no remaining known runtime issue, would it be possible to relax this constraint (for example align it with Symfony’s phpstan/phpdoc-parser <1.30), or remove the upper bound, so that TYPO3-based projects can opt into phpstan/phpdoc-parser ^2.1 when they need newer tooling (like Symfony AI components)?

I’m happy to test a dev build of typo3/cms-cli without the upper-bound conflict (or with a narrower one) in a TYPO3 13.4.x project and report back.

Thanks!

@bnf
Copy link
Member Author

bnf commented Nov 24, 2025

@AstritA Yes, the workaround can be removed by now. Thanks for the HEADS UP.
Do you want to file a PR?

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.

4 participants