Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of phpunit/php-code-coverage.
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
namespace SebastianBergmann\CodeCoverage;
11
 
12
use RuntimeException;
13
 
14
final class UnintentionallyCoveredCodeException extends RuntimeException implements Exception
15
{
16
    /**
17
     * @var array
18
     */
19
    private $unintentionallyCoveredUnits;
20
 
21
    public function __construct(array $unintentionallyCoveredUnits)
22
    {
23
        $this->unintentionallyCoveredUnits = $unintentionallyCoveredUnits;
24
 
25
        parent::__construct($this->toString());
26
    }
27
 
28
    public function getUnintentionallyCoveredUnits(): array
29
    {
30
        return $this->unintentionallyCoveredUnits;
31
    }
32
 
33
    private function toString(): string
34
    {
35
        $message = '';
36
 
37
        foreach ($this->unintentionallyCoveredUnits as $unit) {
38
            $message .= '- ' . $unit . "\n";
39
        }
40
 
41
        return $message;
42
    }
43
}