Completed
Push — fetcher_factories ( ec83ea...40fc6e )
by David
08:11
created

PageNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 1
A getUrl() 0 4 1
1
<?php
2
3
namespace Mouf\Mvc\Splash\Exception;
4
5
/**
6
 * Throw this exception when a page is not found.
7
 * This will generate an HTTP 404 response.
8
 */
9
class PageNotFoundException extends \RuntimeException
10
{
11
    private $url;
12
13
    public static function create(string $url)
14
    {
15
        $exception = new self('Page not found: '.$url, 404);
16
        $exception->url = $url;
17
18
        return $exception;
19
    }
20
21
    /**
22
     * @return string
23
     */
24
    public function getUrl() : string
25
    {
26
        return $this->url;
27
    }
28
}
29