1 | <?php |
||
9 | class NonStringableObject extends LogicException implements ExceptionInterface |
||
10 | { |
||
11 | private const ERROR_TEMPLATE = <<<'ERROR' |
||
12 | The given object %s#%s is not designed to be stringable. |
||
13 | |||
14 | You tried to access a method called "__toString()". |
||
15 | |||
16 | This error is raised because you cannot throw exceptions in "__toString()". |
||
17 | ERROR; |
||
18 | |||
19 | /** |
||
20 | * @param object $object |
||
21 | * |
||
22 | * @return NonStringableObject |
||
23 | * |
||
24 | * @throws TypeError |
||
25 | */ |
||
26 | public static function fromAttemptedToString($object) : self |
||
40 | } |
||
41 |