| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 4.0058 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 7 | public function run() |
|
| 18 | { |
||
| 19 | 7 | $filenames = []; |
|
| 20 | 7 | $iterator = new DirectoryIterator( dirname( __FILE__ ).'/Upgrader' ); |
|
| 21 | 7 | foreach( $iterator as $fileinfo ) { |
|
| 22 | 7 | if( !$fileinfo->isFile() )continue; |
|
| 23 | 7 | $filenames[] = $fileinfo->getFilename(); |
|
| 24 | } |
||
| 25 | 7 | natsort( $filenames ); |
|
| 26 | 7 | array_walk( $filenames, function( $file ) { |
|
| 27 | 7 | $className = str_replace( '.php', '', $file ); |
|
| 28 | 7 | $version = str_replace( 'Upgrade_', '', $className ); |
|
| 29 | 7 | if( version_compare( glsr()->version, $version, '<' ))return; |
|
| 30 | glsr( 'Modules\\Upgrader\\'.$className ); |
||
| 31 | 7 | }); |
|
| 32 | 7 | $this->updateVersion(); |
|
| 33 | 7 | } |
|
| 49 |