Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

autofix incomplete version constraints

Open
#309 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php
Domain
testing, tooling

Research direction

Start by reading the linked pull requests #268 and #308 in phpstan/phpstan-phpunit, then trace where incomplete version constraints are diagnosed and where autofixes are handled. The examples define the expected outcome: constraints with one- or two-part versions should be made autofixable by adding the missing components.

Written by the indexing model from the issue text.

Description

I think we could think about whether errors like

Version requirement is incomplete.

can be made autofixable...?

most obvious examples would be

- #[RequiresPhp('^8.0')]
+ #[RequiresPhp('^8.0.0')]
- #[RequiresPhp('>=8.0')]
+- #[RequiresPhp('>=8.0.0')]
- #[RequiresPhp('>=8')]
+- #[RequiresPhp('>=8.0.0')]
- #[RequiresPhpunit('>=12')]
+- #[RequiresPhpunit('>=12.0.0')]

in which the comparison operator is given, but the version is not 3 digits

see

Dominant language
PHP
Stars
544
Forks
58
Avg merge
2d 1h
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from phpstan/phpstan-phpunit

All issues in phpstan/phpstan-phpunit

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.