| 1 | <?php |
||
| 17 | final class SourceLocation |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Translation key. |
||
| 21 | * |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $message; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | private $path; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var int |
||
| 33 | */ |
||
| 34 | private $line; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var array |
||
| 38 | */ |
||
| 39 | private $context; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param string $message |
||
| 43 | * @param string $path |
||
| 44 | * @param int $line |
||
| 45 | * @param array $context |
||
| 46 | */ |
||
| 47 | 16 | public function __construct($message, $path, $line, array $context = []) |
|
| 54 | |||
| 55 | /** |
||
| 56 | * Create a source location from your current location. |
||
| 57 | * |
||
| 58 | * @param string $message |
||
| 59 | * @param array $context |
||
| 60 | * |
||
| 61 | * @return SourceLocation |
||
| 62 | */ |
||
| 63 | 1 | public static function createHere($message, array $context = []) |
|
| 69 | |||
| 70 | /** |
||
| 71 | * @return string |
||
| 72 | */ |
||
| 73 | 15 | public function getMessage() |
|
| 77 | |||
| 78 | /** |
||
| 79 | * @return string |
||
| 80 | */ |
||
| 81 | 1 | public function getPath() |
|
| 85 | |||
| 86 | /** |
||
| 87 | * @return int |
||
| 88 | */ |
||
| 89 | 4 | public function getLine() |
|
| 93 | |||
| 94 | /** |
||
| 95 | * @return array |
||
| 96 | */ |
||
| 97 | 2 | public function getContext() |
|
| 101 | } |
||
| 102 |