@@ 7-24 (lines=18) @@ | ||
4 | ||
5 | use Exception; |
|
6 | ||
7 | class PropertyNotFoundException extends Exception |
|
8 | { |
|
9 | /** |
|
10 | * Generates: Property '{$propertyName}' not found. |
|
11 | * |
|
12 | * @param string $propertyName |
|
13 | * @param string|null $className Optionally to specify class in abstract/parent classes |
|
14 | * @param \Exception|null $previous |
|
15 | */ |
|
16 | public function __construct($propertyName, $className = null, Exception $previous = null) |
|
17 | { |
|
18 | if ($className === null) { |
|
19 | parent::__construct("Property '{$propertyName}' not found", 0, $previous); |
|
20 | } else { |
|
21 | parent::__construct("Property '{$propertyName}' not found on class '{$className}'", 0, $previous); |
|
22 | } |
|
23 | } |
|
24 | } |
|
25 |
@@ 7-24 (lines=18) @@ | ||
4 | ||
5 | use Exception; |
|
6 | ||
7 | class PropertyReadOnlyException extends Exception |
|
8 | { |
|
9 | /** |
|
10 | * Generates: Property '{$propertyName}' is readonly[ on class '{$className}']. |
|
11 | * |
|
12 | * @param string $propertyName |
|
13 | * @param string|null $className Optionally to specify class in abstract/parent classes |
|
14 | * @param \Exception|null $previous |
|
15 | */ |
|
16 | public function __construct($propertyName, $className = null, Exception $previous = null) |
|
17 | { |
|
18 | if ($className === null) { |
|
19 | parent::__construct("Property '{$propertyName}' is readonly", 0, $previous); |
|
20 | } else { |
|
21 | parent::__construct("Property '{$propertyName}' is readonly on class '{$className}'", 0, $previous); |
|
22 | } |
|
23 | } |
|
24 | } |
|
25 |