| @@ 36-43 (lines=8) @@ | ||
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| 36 | public function getName(): string |
|
| 37 | { |
|
| 38 | $shortName = (new \ReflectionClass(static::class))->getShortName(); |
|
| 39 | if (!preg_match('#^(?<name>.+?)\d+$#', $shortName, $matches)) { |
|
| 40 | throw new MigrationException('Unexpected migration name in '.$shortName); |
|
| 41 | } |
|
| 42 | return $matches['name']; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function getVersion(): int |
|
| 46 | { |
|
| @@ 45-52 (lines=8) @@ | ||
| 42 | return $matches['name']; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function getVersion(): int |
|
| 46 | { |
|
| 47 | $shortName= (new \ReflectionClass(static::class))->getShortName(); |
|
| 48 | if (!preg_match('#(?<version>\d{14})$#', $shortName, $matches)) { |
|
| 49 | throw new MigrationException('Unexpected migration version in '.$shortName); |
|
| 50 | } |
|
| 51 | return intval($matches['version']); |
|
| 52 | } |
|
| 53 | ||
| 54 | public function hasExecuted(): bool |
|
| 55 | { |
|