SeriouslyMalformedUrlException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
/**
4
 * PHP Domain Parser: Public Suffix List based URL parsing.
5
 *
6
 * @link      http://github.com/jeremykendall/php-domain-parser for the canonical source repository
7
 *
8
 * @copyright Copyright (c) 2014 Jeremy Kendall (http://about.me/jeremykendall)
9
 * @license   http://github.com/jeremykendall/php-domain-parser/blob/master/LICENSE MIT License
10
 */
11
namespace Pdp\Exception;
12
13
/**
14
 * Should be thrown when pdp_parse_url() return false.
15
 *
16
 * Exception name based on the PHP documentation: "On seriously malformed URLs,
17
 * parse_url() may return FALSE."
18
 *
19
 * @see http://php.net/parse_url
20
 */
21
class SeriouslyMalformedUrlException extends \InvalidArgumentException implements PdpException
22
{
23
  /**
24
   * Public constructor.
25
   *
26
   * @param string     $malformedUrl URL that caused pdp_parse_url() to return false
27
   * @param int        $code         The Exception code
28
   * @param \Exception $previous     The previous exception used for the exception chaining
29
   */
30 4
  public function __construct($malformedUrl = '', $code = 0, $previous = null)
31
  {
32 4
    $message = sprintf('"%s" is one seriously malformed url.', $malformedUrl);
33 4
    parent::__construct($message, $code, $previous);
34 4
  }
35
}
36