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