Code Duplication    Length = 25-25 lines in 2 locations

src/RenderFailedException.php 1 location

@@ 9-33 (lines=25) @@
6
use Exception;
7
use Throwable;
8
9
class RenderFailedException extends Exception
10
{
11
    /**
12
     * @var string
13
     */
14
    private $source;
15
16
    /**
17
     * @param string $source
18
     * @param Throwable|null $previous
19
     */
20
    public function __construct(string $source, Throwable $previous = null)
21
    {
22
        $this->source = $source;
23
        parent::__construct(sprintf('Failed to render source: %s', $this->source()), 0, $previous);
24
    }
25
26
    /**
27
     * @return string
28
     */
29
    public function source(): string
30
    {
31
        return $this->source;
32
    }
33
}
34

src/TemplateNotFoundException.php 1 location

@@ 9-33 (lines=25) @@
6
use Exception;
7
use Throwable;
8
9
class TemplateNotFoundException extends Exception
10
{
11
    /**
12
     * @var string
13
     */
14
    private $path;
15
16
    /**
17
     * @param string $path
18
     * @param Throwable|null $previous
19
     */
20
    public function __construct(string $path, Throwable $previous = null)
21
    {
22
        $this->path = $path;
23
        parent::__construct(sprintf('Template file not found: %s', $this->path()), 0, $previous);
24
    }
25
26
    /**
27
     * @return string
28
     */
29
    public function path(): string
30
    {
31
        return $this->path;
32
    }
33
}
34