| Total Complexity | 4 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | trait JsonPath |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * An array of path names that correspond to the current stack |
||
| 22 | * |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | protected $pathNames = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * An array of path indices that correspond to the current stack. This array could contain invalid |
||
| 29 | * values at indexes outside the current stack. It could also contain incorrect values at indexes |
||
| 30 | * where a path name is used. Data should only be fetched by referencing the $pathIndex |
||
| 31 | * |
||
| 32 | * @var int[] |
||
| 33 | */ |
||
| 34 | protected $pathIndices = [-1]; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * The current path index corresponding to the pathIndices array |
||
| 38 | * |
||
| 39 | * @var int |
||
| 40 | */ |
||
| 41 | protected $pathIndex = 0; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get the current read path in json xpath format |
||
| 45 | * |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | 82 | public function getPath(): string |
|
| 69 |