@@ -71,7 +71,7 @@ class Coverage
7171 */
7272 protected $ tree = [];
7373
74- public static function get () : self
74+ public static function get (): self
7575 {
7676 if (!static ::$ singleton ) {
7777 static ::$ singleton = new static ();
@@ -85,7 +85,7 @@ public static function reset()
8585 static ::$ singleton = null ;
8686 }
8787
88- public static function getStatus (int $ covered , int $ total ) : string
88+ public static function getStatus (int $ covered , int $ total ): string
8989 {
9090 if ($ covered / max (1 , $ total ) >= 0.9 ) {
9191 return 'success ' ;
@@ -158,7 +158,7 @@ public function initializeCache()
158158 /**
159159 * @return bool
160160 */
161- public function isCoverageAllowedToStop () : bool
161+ public function isCoverageAllowedToStop (): bool
162162 {
163163 return $ this ->coverageStoppingAllowed ;
164164 }
@@ -173,7 +173,7 @@ public function disallowCoverageStopping()
173173 $ this ->coverageStoppingAllowed = false ;
174174 }
175175
176- protected function getPaths () : array
176+ protected function getPaths (): array
177177 {
178178 return $ this ->renderer ->getOption ('paths ' );
179179 }
@@ -199,12 +199,12 @@ public function storeCoverage(array $data)
199199 /**
200200 * @return array
201201 */
202- public function getLastCoverageData () : array
202+ public function getLastCoverageData (): array
203203 {
204204 return $ this ->lastCoverageData ;
205205 }
206206
207- protected function getCoverageData () : array
207+ protected function getCoverageData (): array
208208 {
209209 if (xdebug_code_coverage_started ()) {
210210 $ data = xdebug_get_code_coverage ();
@@ -223,7 +223,7 @@ protected function getCoverageData() : array
223223 // @codeCoverageIgnoreEnd
224224 }
225225
226- private function getLocationPath (string $ path ) : string
226+ private function getLocationPath (string $ path ): string
227227 {
228228 foreach ($ this ->getPaths () as $ base ) {
229229 $ realBase = realpath ($ base );
@@ -244,7 +244,7 @@ private function getLocationPath(string $path) : string
244244 // @codeCoverageIgnoreEnd
245245 }
246246
247- protected function getTemplateFile (string $ file , array $ vars ) : string
247+ protected function getTemplateFile (string $ file , array $ vars ): string
248248 {
249249 $ __php = file_get_contents (__DIR__ ."/../../template/ $ file " );
250250 extract ($ vars );
@@ -254,7 +254,7 @@ protected function getTemplateFile(string $file, array $vars) : string
254254 return ob_get_clean ();
255255 }
256256
257- protected function writeFile (string $ path , string $ contents ) : bool
257+ protected function writeFile (string $ path , string $ contents ): bool
258258 {
259259 $ base = dirname ($ path );
260260 if (!is_dir ($ base )) {
@@ -294,7 +294,7 @@ protected function listNodes(SplObjectStorage $list, ElementInterface $element)
294294 }
295295 }
296296
297- protected function countFileNodes (string $ file ) : int
297+ protected function countFileNodes (string $ file ): int
298298 {
299299 $ document = $ this ->renderer ->getCompiler ()->compileFileIntoElement ($ file );
300300 $ list = new SplObjectStorage ();
@@ -480,7 +480,7 @@ public function dumpCoverage(bool $output = false, string $directory = null)
480480 /**
481481 * @return Renderer
482482 */
483- public function createRenderer ($ renderer , array $ options = []) : Renderer
483+ public function createRenderer ($ renderer , array $ options = []): Renderer
484484 {
485485 if (is_string ($ renderer )) {
486486 $ renderer = new $ renderer ($ options );
@@ -500,7 +500,7 @@ public function setThreshold($threshold)
500500 $ this ->threshold = floatval ($ threshold );
501501 }
502502
503- public function isThresholdReached () : bool
503+ public function isThresholdReached (): bool
504504 {
505505 if ($ this ->threshold ) {
506506 echo "\nOverall coverage is {$ this ->lastCoverageRate }%. \n" ;
0 commit comments