11<?php
2-
2+ /**
3+ * This file is part of the leanphp/phpspec-code-coverage package
4+ *
5+ * For the full copyright and license information, please see the LICENSE file
6+ * that was distributed with this source code.
7+ *
8+ * @license MIT
9+ */
310namespace LeanPHP \PhpSpec \CodeCoverage \Listener ;
411
512use PhpSpec \Console \ConsoleIO ;
@@ -20,6 +27,12 @@ class CodeCoverageListener implements EventSubscriberInterface
2027 private $ options ;
2128 private $ enabled ;
2229
30+ /**
31+ * @param ConsoleIO $io
32+ * @param CodeCoverage $coverage
33+ * @param [] $reports
34+ * @param boolean $skipCoverage
35+ */
2336 public function __construct (ConsoleIO $ io , CodeCoverage $ coverage , array $ reports , $ skipCoverage = false )
2437 {
2538 $ this ->io = $ io ;
@@ -40,6 +53,8 @@ public function __construct(ConsoleIO $io, CodeCoverage $coverage, array $report
4053 /**
4154 * Note: We use array_map() instead of array_walk() because the latter expects
4255 * the callback to take the value as the first and the index as the seconds parameter.
56+ *
57+ * @param SuiteEvent $event
4358 */
4459 public function beforeSuite (SuiteEvent $ event )
4560 {
@@ -67,6 +82,9 @@ public function beforeSuite(SuiteEvent $event)
6782 );
6883 }
6984
85+ /**
86+ * @param ExampleEvent $event
87+ */
7088 public function beforeExample (ExampleEvent $ event )
7189 {
7290 if (!$ this ->enabled ) {
@@ -83,6 +101,9 @@ public function beforeExample(ExampleEvent $event)
83101 $ this ->coverage ->start ($ name );
84102 }
85103
104+ /**
105+ * @param ExampleEvent $event
106+ */
86107 public function afterExample (ExampleEvent $ event )
87108 {
88109 if (!$ this ->enabled ) {
@@ -92,6 +113,9 @@ public function afterExample(ExampleEvent $event)
92113 $ this ->coverage ->stop ();
93114 }
94115
116+ /**
117+ * @param SuiteEvent $event
118+ */
95119 public function afterSuite (SuiteEvent $ event )
96120 {
97121 if (!$ this ->enabled ) {
@@ -120,6 +144,9 @@ public function afterSuite(SuiteEvent $event)
120144 }
121145 }
122146
147+ /**
148+ * @param [] $options
149+ */
123150 public function setOptions (array $ options )
124151 {
125152 $ this ->options = $ options + $ this ->options ;
0 commit comments