| @@ -5,8 +5,10 @@ | ||
| 5 | 5 | namespace Yatra\Upgrades; |
| 6 | 6 | |
| 7 | 7 | use Yatra\Upgrades\Contracts\UpgradeStepInterface; |
| 8 | 8 | use Yatra\Upgrades\Versions\Upgrade_3_0_3; |
| 9 | +use Yatra\Upgrades\Versions\Upgrade_3_0_5; | |
| 10 | +use Yatra\Upgrades\Versions\Upgrade_3_0_17; | |
| 9 | 11 | |
| 10 | 12 | /** |
| 11 | 13 | * Register Free upgrade steps (add a class per release when DB/data migration is required). |
| 12 | 14 | * |
| @@ -24,8 +26,10 @@ | ||
| 24 | 26 | public static function allSteps(): array |
| 25 | 27 | { |
| 26 | 28 | return [ |
| 27 | 29 | Upgrade_3_0_3::class, |
| 30 | + Upgrade_3_0_5::class, | |
| 31 | + Upgrade_3_0_17::class, | |
| 28 | 32 | ]; |
| 29 | 33 | } |
| 30 | 34 | |
| 31 | 35 | /** |
| @@ -39,10 +43,15 @@ | ||
| 39 | 43 | $out[] = $class; |
| 40 | 44 | } |
| 41 | 45 | } |
| 42 | 46 | |
| 47 | + // version_compare() with two args returns -1 / 0 / 1 — exactly | |
| 48 | + // what usort wants. Passing '<=>' as the operator (legacy mistake) | |
| 49 | + // throws a ValueError under PHP 8+ since '<=>' isn't in the | |
| 50 | + // operator allowlist; pre-PHP 8 it silently returned null and | |
| 51 | + // usort would have produced an unstable ordering anyway. | |
| 43 | 52 | usort($out, static function (string $a, string $b): int { |
| 44 | - return version_compare($a::targetVersion(), $b::targetVersion(), '<=>'); | |
| 53 | + return version_compare($a::targetVersion(), $b::targetVersion()); | |
| 45 | 54 | }); |
| 46 | 55 | |
| 47 | 56 | return $out; |
| 48 | 57 | } |