Skip to content

extract php version string parsing into separate re-usable package #6756

@staabm

Description

@staabm

atm I try to implement a phpstan rule which detects "always false" #[RequiresPhp(....)] uses in the codebase by comparing it against the composer.json version constraints.

to get this working, I need to mimic phpunits php version parsing and checking.

therefore I need to use PharIo\Version, but combine it with some additional phpunit specific fallback logic.

for tooling which tries to be compatible with phpunit, it would be great if such logic could be extracted. that way I don't need to re-implement it and keep track of possible changes in the future.

do you think this would be possible?
(I would need a PHP 7.4 compatible version though)

my current work-in-progress with duplicated phpunit version parsing is here: phpstan/phpstan-phpunit#269

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementA new idea that should be implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions