| Total Complexity | 6 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 75% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Upgrader |
||
| 11 | { |
||
| 12 | 7 | public function run() |
|
| 13 | { |
||
| 14 | 7 | $routines = (new ReflectionClass( __CLASS__ ))->getMethods( ReflectionMethod::IS_PROTECTED ); |
|
| 15 | 7 | $routines = array_column( $routines, 'name' ); |
|
| 16 | 7 | natsort( $routines ); |
|
| 17 | 7 | array_walk( $routines, function( $routine ) { |
|
| 18 | 7 | $version = str_replace( strtolower( __CLASS__ ).'_', '', $routine ); |
|
| 19 | 7 | if( version_compare( glsr()->version, $version, '>=' ))return; |
|
| 20 | call_user_func( [$this, $routine] ); |
||
| 21 | 7 | }); |
|
| 22 | 7 | $this->updateVersion(); |
|
| 23 | 7 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @return void |
||
| 27 | */ |
||
| 28 | 7 | public function updateVersion() |
|
| 36 | } |
||
| 37 | 7 | } |
|
| 38 | |||
| 39 | protected function upgrade_3_0_0() |
||
| 41 | } |
||
| 42 |