-
-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathBrokenLinkException.php
53 lines (46 loc) · 1.02 KB
/
BrokenLinkException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\apidoc\helpers;
use yii\apidoc\models\TypeDoc;
use yii\base\Exception;
/**
* BrokenLinkException represents a broken API link.
*
* @author Brandon Kelly
* @since 2.1.3
*/
class BrokenLinkException extends Exception
{
/**
* @var string
*/
public $object;
/**
* @var TypeDoc|null
*/
public $context;
/**
* Constructor.
*
* @param string $object
* @param TypeDoc|null $context
*/
public function __construct($object, $context)
{
$this->object = $object;
$this->context = $context;
$message = 'broken link to ' . $object . (($context !== null) ? ' in ' . $context->name : '');
parent::__construct($message);
}
/**
* @return string the user-friendly name of this exception
*/
public function getName()
{
return 'Broken Link';
}
}