ElkanRoelen / behatformatter

Behat 3 Twig formatter
Other
17 stars 17 forks source link

Changed the parameter type of BehatFormatter::onAfterExercise(): #14

Open mdolnik-eelzee opened 1 year ago

mdolnik-eelzee commented 1 year ago

When canceling a behat test via Ctrl+C, this method will receive an AfterExerciseAborted object when it's expecting only a AfterExerciseCompleted object.

This will result in an error with the following message: TypeError: Argument 1 passed to elkan\BehatFormatter\Formatter\BehatFormatter::onAfterExercise() must be an instance of Behat\Testwork\EventDispatcher\Event\AfterExerciseCompleted, instance of Behat\Testwork\EventDispatcher\Event\AfterExerciseAborted given

Since this method can receive both AfterExerciseAborted / AfterExerciseCompleted objects the parameter type docs was changed to both, and the strict parameter type was changed to the common parent of both classes: ExerciseCompleted