| 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 | 29 | 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 | 4 | public static function createHere($message, array $context = []) |
|
| 74 | |||
| 75 | /** |
||
| 76 | * @return string |
||
| 77 | */ |
||
| 78 | 28 | public function getMessage() |
|
| 82 | |||
| 83 | /** |
||
| 84 | * @return string |
||
| 85 | */ |
||
| 86 | 3 | public function getPath() |
|
| 90 | |||
| 91 | /** |
||
| 92 | * @return int |
||
| 93 | */ |
||
| 94 | 6 | public function getLine() |
|
| 98 | |||
| 99 | /** |
||
| 100 | * @return array |
||
| 101 | */ |
||
| 102 | 9 | public function getContext() |
|
| 106 | } |
||
| 107 |
It seems like you are relying on a variable being defined by an iteration: