1 | <?php |
||
13 | class RetryParser implements JSONParserChainElementInterface, OutputContainerBearerInterface |
||
14 | { |
||
15 | /** @var OutputContainerInterface */ |
||
16 | private $outputContainer; |
||
17 | |||
18 | /** @var int */ |
||
19 | private $maxRetryCount; |
||
20 | |||
21 | /** @var string */ |
||
22 | private $regexPattern; |
||
23 | |||
24 | /** |
||
25 | * RetryParser constructor. |
||
26 | * @param OutputContainerInterface $outputContainer |
||
27 | * @param int $maxRetryCount |
||
28 | */ |
||
29 | 33 | public function __construct(OutputContainerInterface $outputContainer, $maxRetryCount = 3) |
|
45 | |||
46 | /** |
||
47 | * @return OutputContainerInterface |
||
48 | */ |
||
49 | 14 | public function getOutputContainer() |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 24 | public function parsingFoundResult(ProcessResultInterface $process, \stdClass $log) |
|
71 | |||
72 | /** |
||
73 | * @param \stdClass $log |
||
74 | * @return bool |
||
75 | */ |
||
76 | 24 | private function isToBeRetried(\stdClass $log) |
|
80 | |||
81 | |||
82 | 8 | private function hasNotExceededRetryCount(RetryAwareInterface $process) |
|
86 | |||
87 | /** |
||
88 | * @param array | string[] $patterns |
||
89 | * @return string |
||
90 | */ |
||
91 | 33 | private function buildRegexPattern(array $patterns) |
|
97 | } |
||
98 |