Title: Check `#[RequiresPhpunit(....)]` in the same way we check `#[RequiresPhp(...)]` · Issue #302 · phpstan/phpstan-phpunit · GitHub
Open Graph Title: Check `#[RequiresPhpunit(....)]` in the same way we check `#[RequiresPhp(...)]` · Issue #302 · phpstan/phpstan-phpunit
X Title: Check `#[RequiresPhpunit(....)]` in the same way we check `#[RequiresPhp(...)]` · Issue #302 · phpstan/phpstan-phpunit
Description: there is a RequiresPhpunit attribute which supports similar version constraints RequiresPhp does, e.g. #[RequiresPhpunit('>= 10.1.0')] https://docs.phpunit.de/en/10.5/attributes.html#requiresphpunit we should run the same sanity checks o...
Open Graph Description: there is a RequiresPhpunit attribute which supports similar version constraints RequiresPhp does, e.g. #[RequiresPhpunit('>= 10.1.0')] https://docs.phpunit.de/en/10.5/attributes.html#requiresphpuni...
X Description: there is a RequiresPhpunit attribute which supports similar version constraints RequiresPhp does, e.g. #[RequiresPhpunit('>= 10.1.0')] https://docs.phpunit.de/en/10.5/attributes.html#req...
Opengraph URL: https://github.com/phpstan/phpstan-phpunit/issues/302
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Check `#[RequiresPhpunit(....)]` in the same way we check `#[RequiresPhp(...)]`","articleBody":"there is a `RequiresPhpunit` attribute which supports similar version constraints `RequiresPhp` does, e.g. `#[RequiresPhpunit('>= 10.1.0')]`\n\nhttps://docs.phpunit.de/en/10.5/attributes.html#requiresphpunit\n\nwe should run the same sanity checks on it. see initial implementation in \n- https://github.com/phpstan/phpstan-phpunit/pull/268\n- https://github.com/phpstan/phpstan-phpunit/pull/269\n\n---\n\nexample\n\n```\n\t#[RequiresPhp('>= 8.3')]\n\t#[RequiresPhpunit('>= 8.5')]\n\tpublic function testFixWithPipe(): void\n\t{\n\t\t$this->fix(__DIR__ . '/data/final-class-rule-pipe.php', __DIR__ . '/data/final-class-rule-pipe.php.fixed');\n\t}\n```\n\nresults in \n```\n➜ phpstan-src git:(2.2.x) ✗ /Users/m.staab/dvl/phpunit/phpunit tests/PHPStan/Build/FinalClassRuleTest.php\nPHPUnit 13.3-gab1fecc8a by Sebastian Bergmann and contributors.\n\nRuntime: PHP 8.5.7\nConfiguration: /Users/m.staab/dvl/phpstan-src/phpunit.xml\nRandom Seed: 1782378584\n\n... 3 / 3 (100%)\n\nTime: 00:02.046, Memory: 78.50 MB\n\nThere were 2 PHPUnit test runner warnings:\n\n1) Incomplete version requirement \"8.3\" used by PHPStan\\Build\\FinalClassRuleTest::testFixWithPipe()\n\n2) Incomplete version requirement \"8.5\" used by PHPStan\\Build\\FinalClassRuleTest::testFixWithPipe()\n\nOK, but there were issues!\nTests: 3, Assertions: 3, PHPUnit Warnings: 4.\n```","author":{"url":"https://github.com/staabm","@type":"Person","name":"staabm"},"datePublished":"2026-06-18T09:44:43Z","url":"https://github.com/phpstan/phpstan-phpunit/issues/302"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7ca32247-39ee-48f2-570e-c6630b302444 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E4F6:0DB8:3D68B1:553A5B:6B008D0F |
| html-safe-nonce | 2cabb2d14b7fb0b9db76ca49df4767fcc066eb7d8ce2cf35af9b456c205d6ee8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEY2OjBEQjg6M0Q2OEIxOjU1M0E1Qjo2QjAwOEQwRiIsInZpc2l0b3JfaWQiOiIzMTQ4MTI1ODk0OTIxNDU2OTExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4304f59ea52c2835d4e5e9df860f64c768e879859d765c59d5d9b51b0214f60b |
| hovercard-subject-tag | issue:4691162704 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/phpstan/phpstan-phpunit/302/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0a739e2b767acbb6f9dc9e3c6d79644d2cedc04151b5ad3701ad661ebd9e922b/phpstan/phpstan-phpunit/issues/302 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0a739e2b767acbb6f9dc9e3c6d79644d2cedc04151b5ad3701ad661ebd9e922b/phpstan/phpstan-phpunit/issues/302 |
| og:image:alt | there is a RequiresPhpunit attribute which supports similar version constraints RequiresPhp does, e.g. #[RequiresPhpunit('>= 10.1.0')] https://docs.phpunit.de/en/10.5/attributes.html#requiresphpuni... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | staabm |
| hostname | github.com |
| expected-hostname | github.com |
| None | c710a5cb5c47be60abfe6e8410436d409906979dbed614ef09f29c60f5535b08 |
| turbo-cache-control | no-preview |
| go-import | github.com/phpstan/phpstan-phpunit git https://github.com/phpstan/phpstan-phpunit.git |
| octolytics-dimension-user_id | 16435710 |
| octolytics-dimension-user_login | phpstan |
| octolytics-dimension-repository_id | 105883921 |
| octolytics-dimension-repository_nwo | phpstan/phpstan-phpunit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 105883921 |
| octolytics-dimension-repository_network_root_nwo | phpstan/phpstan-phpunit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | be616a2a6ec1c609d6e002896dff5352d5c5f28b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width