| 1 | <?php |
||
| 17 | class ListPatcher extends ThrowingPatcher { |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @see Patcher::patch |
||
| 21 | * |
||
| 22 | * Applies the provided diff to the provided array and returns the result. |
||
| 23 | * The provided diff needs to be non-associative. In other words, calling |
||
| 24 | * isAssociative on it should return false. |
||
| 25 | * |
||
| 26 | * Note that remove operations can introduce gaps into the input array $base. |
||
| 27 | * For instance, when the input is [ 0 => 'a', 1 => 'b', 2 => 'c' ], and there |
||
| 28 | * is one remove operation for 'b', the result will be [ 0 => 'a', 2 => 'c' ]. |
||
| 29 | * |
||
| 30 | * @since 0.4 |
||
| 31 | * |
||
| 32 | * @param array $base |
||
| 33 | * @param Diff $diff |
||
| 34 | * |
||
| 35 | * @return array |
||
| 36 | * @throws PatcherException |
||
| 37 | */ |
||
| 38 | 15 | public function patch( array $base, Diff $diff ): array { |
|
| 60 | |||
| 61 | } |
||
| 62 |