Mercurial > hg > isophonics-drupal-site
comparison vendor/phpunit/php-code-coverage/src/Exception/UnintentionallyCoveredCodeException.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | |
2 /* | |
3 * This file is part of the php-code-coverage package. | |
4 * | |
5 * (c) Sebastian Bergmann <sebastian@phpunit.de> | |
6 * | |
7 * For the full copyright and license information, please view the LICENSE | |
8 * file that was distributed with this source code. | |
9 */ | |
10 | |
11 namespace SebastianBergmann\CodeCoverage; | |
12 | |
13 /** | |
14 * Exception that is raised when code is unintentionally covered. | |
15 */ | |
16 class UnintentionallyCoveredCodeException extends RuntimeException | |
17 { | |
18 /** | |
19 * @var array | |
20 */ | |
21 private $unintentionallyCoveredUnits = []; | |
22 | |
23 /** | |
24 * @param array $unintentionallyCoveredUnits | |
25 */ | |
26 public function __construct(array $unintentionallyCoveredUnits) | |
27 { | |
28 $this->unintentionallyCoveredUnits = $unintentionallyCoveredUnits; | |
29 | |
30 parent::__construct($this->toString()); | |
31 } | |
32 | |
33 /** | |
34 * @return array | |
35 */ | |
36 public function getUnintentionallyCoveredUnits() | |
37 { | |
38 return $this->unintentionallyCoveredUnits; | |
39 } | |
40 | |
41 /** | |
42 * @return string | |
43 */ | |
44 private function toString() | |
45 { | |
46 $message = ''; | |
47 | |
48 foreach ($this->unintentionallyCoveredUnits as $unit) { | |
49 $message .= '- ' . $unit . "\n"; | |
50 } | |
51 | |
52 return $message; | |
53 } | |
54 } |