{"action":"created","issue":{"url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/1883","labels_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/1883/labels{/name}","comments_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/1883/comments","events_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/1883/events","html_url":"https://github.com/sebastianbergmann/phpunit/issues/1883","id":109251550,"number":1883,"title":"The typehint change in onNotSuccessfulTests makes it a pain to support PHPUnit 4.8 and 5.0 at the same time","user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-01T08:22:40Z","updated_at":"2015-10-01T09:01:38Z","closed_at":null,"body":"This method is an extension point for child classes, which means they must match the signature.\r\n\r\nGiven that 4.8 does not support PHP 7 and 5.0 only supports 5.6+, it would mean that a project wanting to support PHP 5.5 and PHP 7 at the same time (Symfony for instance) would have to be able to run its testsuite against both PHPUnit 4.8 and 5.0. The typehint change means that it can do it only if it never uses the ``onNotSuccessfulTests`` extension point.\r\n\r\nWouldn't it be possible to change the way the support of ``Error`` is handled in the extension point ?"},"comment":{"url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/comments/144662397","html_url":"https://github.com/sebastianbergmann/phpunit/issues/1883#issuecomment-144662397","issue_url":"https://api.github.com/repos/sebastianbergmann/phpunit/issues/1883","id":144662397,"user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T09:01:38Z","updated_at":"2015-10-01T09:01:38Z","body":"> And they can, by using different versions of PHPUnit.\r\n\r\nThey can only if they never use your ``onNotSuccessfulTest``. Because the same code cannot overwrite the method as ``onNotSuccessfulTest(\\Exception $e)`` and ``onNotSuccessfulTest($e)`` at the same time. You will get a signature mismatch with one of the PHPUnit version.\r\n\r\nthis makes the ``onNotSuccessfulTest`` impossible to use for any project needing to stay compatible with 4.8 and 5.0 because of the PHP requirements.\r\nNote that I'm fine with you bumping the min PHP version in 5.0. what I would like to see is a BC way to handle ``onNotSuccessfulTest`` (maybe using a new method in case of error)"}}