| @@ 17-46 (lines=30) @@ | ||
| 14 | /** |
|
| 15 | * Error thrown when a property is not thingable. |
|
| 16 | */ |
|
| 17 | abstract class AbstractPropertyNotThingableException extends Exception |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * Wraps to Exception::__construct(). |
|
| 21 | * |
|
| 22 | * @param string $thing the type of thing that the $property cannot do, i.e. writeable, nullable |
|
| 23 | * @param string $className name of the class on which the property is not thingable |
|
| 24 | * @param string $property name of the property which is not thingable |
|
| 25 | * @param int $code @see Exception::__construct() |
|
| 26 | * @param Throwable|null $previous @see Exception::__construct() |
|
| 27 | */ |
|
| 28 | public function __construct( |
|
| 29 | string $thing, |
|
| 30 | string $className, |
|
| 31 | string $property, |
|
| 32 | int $code = 0, |
|
| 33 | Throwable $previous = null |
|
| 34 | ) { |
|
| 35 | parent::__construct( |
|
| 36 | sprintf( |
|
| 37 | 'Property not %s: %s::$%s', |
|
| 38 | $thing, |
|
| 39 | $className, |
|
| 40 | $property |
|
| 41 | ), |
|
| 42 | $code, |
|
| 43 | $previous |
|
| 44 | ); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 17-43 (lines=27) @@ | ||
| 14 | /** |
|
| 15 | * Exception thrown when a property is not defined. |
|
| 16 | */ |
|
| 17 | class UndefinedPropertyException extends Exception |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * Wraps to Exception::__construct(). |
|
| 21 | * |
|
| 22 | * @param string $className name of the class on which the property is not defined |
|
| 23 | * @param string $property name of the property which is not defined |
|
| 24 | * @param int $code @see Exception::__construct() |
|
| 25 | * @param Throwable|null $previous @see Exception::__construct() |
|
| 26 | */ |
|
| 27 | public function __construct( |
|
| 28 | string $className, |
|
| 29 | string $property, |
|
| 30 | int $code = 0, |
|
| 31 | Throwable $previous = null |
|
| 32 | ) { |
|
| 33 | parent::__construct( |
|
| 34 | sprintf( |
|
| 35 | 'Undefined property: %s::$%s', |
|
| 36 | $className, |
|
| 37 | $property |
|
| 38 | ), |
|
| 39 | $code, |
|
| 40 | $previous |
|
| 41 | ); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||