| Total Complexity | 5 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 83.33% |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class ProxyCoverage implements EventSubscriberInterface |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var CodeCoverage |
||
| 25 | */ |
||
| 26 | private $coverage; |
||
| 27 | |||
| 28 | 3 | public static function getSubscribedEvents() |
|
| 29 | { |
||
| 30 | return [ |
||
| 31 | 3 | CoverageEvent::STOP => ['onCoverageStopped', 10], |
|
| 32 | 3 | CoverageEvent::REFRESH => 'onCoverageRefresh', |
|
| 33 | 3 | ReportEvent::BEFORE_PROCESS => 'onBeforeReport', |
|
| 34 | ]; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * ProxyCoverage constructor. |
||
| 39 | * |
||
| 40 | * @param CodeCoverage $coverage |
||
| 41 | */ |
||
| 42 | 6 | public function __construct( |
|
| 46 | } |
||
| 47 | |||
| 48 | 1 | public function onCoverageStopped(CoverageEvent $event) |
|
| 49 | { |
||
| 50 | 1 | $this->coverage->append($event->getAggregate()->getCoverage(), $event->getCoverageId()); |
|
| 51 | } |
||
| 52 | |||
| 53 | public function onCoverageRefresh() |
||
| 54 | { |
||
| 55 | $this->coverage->clear(); |
||
| 56 | } |
||
| 57 | |||
| 58 | 1 | public function onBeforeReport(ReportEvent $event) |
|
| 61 | } |
||
| 62 | } |
||
| 63 |