File tree Expand file tree Collapse file tree 1 file changed +0
-37
lines changed
Expand file tree Collapse file tree 1 file changed +0
-37
lines changed Original file line number Diff line number Diff line change 1313use Behat \Behat \EventDispatcher \Event \ScenarioTested ;
1414use Facebook \WebDriver \Exception \UnknownErrorException ;
1515use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
16- use Symfony \Component \HttpKernel \KernelInterface ;
1716
1817class StartScenarioSubscriber implements EventSubscriberInterface
1918{
2019 private const RETRY_LIMIT = 2 ;
2120
2221 public const PRIORITY = -1000 ;
2322
24- private KernelInterface $ kernel ;
25-
26- private int $ width ;
27-
28- private int $ height ;
29-
30- public function __construct (KernelInterface $ kernel , int $ width , int $ height )
31- {
32- $ this ->kernel = $ kernel ;
33- $ this ->width = $ width ;
34- $ this ->height = $ height ;
35- }
36-
3723 public static function getSubscribedEvents ()
3824 {
3925 return [
@@ -46,27 +32,4 @@ public function resizeWindow(BeforeScenarioTested $event): void
4632 {
4733 // No usages, so simplest fix is to remove the function
4834 }
49-
50- /**
51- * @template T
52- *
53- * @param callable(mixed ...$args): T $fn
54- *
55- * @return T
56- */
57- private function executeWithRetry (callable $ fn )
58- {
59- $ counter = 0 ;
60- while (true ) {
61- try {
62- return $ fn ();
63- } catch (UnknownErrorException $ e ) {
64- if ($ counter > self ::RETRY_LIMIT ) {
65- throw $ e ;
66- }
67- ++$ counter ;
68- usleep (100000 * 2 ** $ counter );
69- }
70- }
71- }
7235}
You can’t perform that action at this time.
0 commit comments