0

I am migrating a laravel 5.2 project from php 5.6 to php 7.3 and am having problems with one function.

I tried using foreach but I could not refactor the code

public function boot(){
$modules = config("modules");
while (list(,$modulo) = each($modules)) {
    if(is_dir(__DIR__.'/'.$modulo)) {
        $folders = array_diff(scandir(__DIR__.'/'.$modulo), ['.', '..']);
        while (list(,$module) = each($folders)) {
            if(file_exists(__DIR__.'/'.$modulo.'/routes.php')) {
                include __DIR__.'/'.$modulo.'/routes.php';
            }
            if(is_dir(__DIR__.'/'.$modulo.'/Views')) {
                $this->loadViewsFrom(__DIR__.'/'.$modulo.'/Views', $modulo);
            }
        }
    }
}

Path: App...\ModuleProvider.php

0 Answers0