| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 9 | public static function fromAttemptedCall($object, string $method) : self |
|
| 24 | { |
||
| 25 | 9 | if (! is_object($object)) { |
|
| 26 | 7 | throw TypeError::fromNonObject($object); |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | $className = get_class($object); |
|
| 30 | |||
| 31 | 2 | return new self(sprintf( |
|
| 32 | 2 | self::ERROR_TEMPLATE, |
|
| 33 | 2 | $className, |
|
| 34 | 2 | spl_object_hash($object), |
|
| 35 | 2 | $method |
|
| 36 | )); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |