1 | <?php |
||
24 | class Art |
||
25 | { |
||
26 | /** |
||
27 | * @param Exception $exception |
||
28 | * @return string |
||
29 | */ |
||
30 | public static function forException(Exception $exception) |
||
34 | |||
35 | /** |
||
36 | * @param FlattenException $exception |
||
37 | * @return string |
||
38 | */ |
||
39 | public static function forFlattenException(FlattenException $exception) |
||
43 | |||
44 | /** |
||
45 | * @param string $className |
||
46 | * @param string $message |
||
47 | * @return string |
||
48 | */ |
||
49 | private static function calculateArt($className, $message) |
||
55 | |||
56 | /** |
||
57 | * Strip variable arguments from exception messages. |
||
58 | * |
||
59 | * Some exception messages are formatted using sprintf, and result in a |
||
60 | * unique art-code for each distinct message. In order for the art-code to |
||
61 | * be useful it must be the same for each distinct error situation without |
||
62 | * taking into account variable parts of the message. |
||
63 | * |
||
64 | * This method strips all strings inside quotes. This is not perfect |
||
65 | * because it relies on sprintf arguments to always be quoted inside the |
||
66 | * message. |
||
67 | * |
||
68 | * @param $message |
||
69 | * @return string |
||
70 | */ |
||
71 | private static function stripVariableArgumentsFromMessage($message) |
||
75 | } |
||
76 |