| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 85.71% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class SwapLocationResponse implements LocationResponseInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var Location The new location to swap with the current location. |
||
| 16 | */ |
||
| 17 | private $newLocation; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * SwapLocationResponse constructor. |
||
| 21 | * |
||
| 22 | * @param Location $newLocation The new location to swap with the current location. |
||
| 23 | */ |
||
| 24 | 2 | public function __construct(Location $newLocation) |
|
| 25 | { |
||
| 26 | 2 | $this->newLocation = $newLocation; |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Performs the location response action by swapping the current location with the new location. |
||
| 31 | * |
||
| 32 | * @param Location|null $oldLocation The current location. |
||
| 33 | * @return Location The resulting location after the swap, will be the new location. |
||
| 34 | */ |
||
| 35 | 1 | public function doLocationResponse(?Location $oldLocation): Location |
|
| 44 | } |
||
| 45 | } |
||
| 46 |