original_string: private function getAllModels()
      {
          $modules      = Safan::handler()->getModules();
          $modelClasses = [];
  
          foreach ($modules as $moduleName => $modulePath) {
              $modelsPath = APP_BASE_PATH . DS . $modulePath . DS . 'Models';
  
              $modelFiles = [];
  
              if (is_dir($modelsPath)) {
                  $modelFiles = scandir($modelsPath);
              }
  
              foreach ($modelFiles as $modelFile) {
                  if ($modelFile != '.' && $modelFile != '..' && is_dir($modelsPath . DS . $modelFile)) {
                      $subModelFiles = scandir($modelsPath . DS . $modelFile);
  
                      foreach ($subModelFiles as $subModelFile) {
                          if ($subModelFile != '.' && $subModelFile != '..' && is_file($modelsPath . DS . $modelFile . DS . $subModelFile)) {
                              $subModelName   = substr($subModelFile, 0, -4);
                              $modelClasses[] = [
                                  'name'      => $subModelName,
                                  'namespace' => '\\' . $moduleName . '\\Models\\' . $modelFile . '\\' . $subModelName,
                                  'file'      => $modelsPath . DS . $modelFile . DS . $subModelFile
                              ];
                          }
                      }
                  } elseif ($modelFile != '.' && $modelFile != '..' && is_file($modelsPath . DS . $modelFile)) {
                      $modelName      = substr($modelFile, 0, -4);
                      $modelClasses[] = [
                          'name'      => $modelName,
                          'namespace' => '\\' . $moduleName . '\\Models\\' . $modelName,
                          'file'      => $modelsPath . DS . $modelFile
                      ];
                  }
  
              }
          }
  
          return $modelClasses;
      }
code: private function getAllModels()
      {
          $modules      = Safan::handler()->getModules();
          $modelClasses = [];
  
          foreach ($modules as $moduleName => $modulePath) {
              $modelsPath = APP_BASE_PATH . DS . $modulePath . DS . 'Models';
  
              $modelFiles = [];
  
              if (is_dir($modelsPath)) {
                  $modelFiles = scandir($modelsPath);
              }
  
              foreach ($modelFiles as $modelFile) {
                  if ($modelFile != '.' && $modelFile != '..' && is_dir($modelsPath . DS . $modelFile)) {
                      $subModelFiles = scandir($modelsPath . DS . $modelFile);
  
                      foreach ($subModelFiles as $subModelFile) {
                          if ($subModelFile != '.' && $subModelFile != '..' && is_file($modelsPath . DS . $modelFile . DS . $subModelFile)) {
                              $subModelName   = substr($subModelFile, 0, -4);
                              $modelClasses[] = [
                                  'name'      => $subModelName,
                                  'namespace' => '\\' . $moduleName . '\\Models\\' . $modelFile . '\\' . $subModelName,
                                  'file'      => $modelsPath . DS . $modelFile . DS . $subModelFile
                              ];
                          }
                      }
                  } elseif ($modelFile != '.' && $modelFile != '..' && is_file($modelsPath . DS . $modelFile)) {
                      $modelName      = substr($modelFile, 0, -4);
                      $modelClasses[] = [
                          'name'      => $modelName,
                          'namespace' => '\\' . $moduleName . '\\Models\\' . $modelName,
                          'file'      => $modelsPath . DS . $modelFile
                      ];
                  }
  
              }
          }
  
          return $modelClasses;
      }
code_tokens: private function getAllModels ( ) { $ modules = Safan :: handler ( ) -> getModules ( ) ; $ modelClasses = [ ] ; foreach ( $ modules as $ moduleName => $ modulePath ) { $ modelsPath = APP_BASE_PATH . DS . $ modulePath . DS . 'Models' ; $ modelFiles = [ ] ; if ( is_dir ( $ modelsPath ) ) { $ modelFiles = scandir ( $ modelsPath ) ; } foreach ( $ modelFiles as $ modelFile ) { if ( $ modelFile != '.' && $ modelFile != '..' && is_dir ( $ modelsPath . DS . $ modelFile ) ) { $ subModelFiles = scandir ( $ modelsPath . DS . $ modelFile ) ; foreach ( $ subModelFiles as $ subModelFile ) { if ( $ subModelFile != '.' && $ subModelFile != '..' && is_file ( $ modelsPath . DS . $ modelFile . DS . $ subModelFile ) ) { $ subModelName = substr ( $ subModelFile , 0 , - 4 ) ; $ modelClasses [ ] = [ 'name' => $ subModelName , 'namespace' => '\\' . $ moduleName . '\\Models\\' . $ modelFile . '\\' . $ subModelName , 'file' => $ modelsPath . DS . $ modelFile . DS . $ subModelFile ] ; } } } elseif ( $ modelFile != '.' && $ modelFile != '..' && is_file ( $ modelsPath . DS . $ modelFile ) ) { $ modelName = substr ( $ modelFile , 0 , - 4 ) ; $ modelClasses [ ] = [ 'name' => $ modelName , 'namespace' => '\\' . $ moduleName . '\\Models\\' . $ modelName , 'file' => $ modelsPath . DS . $ modelFile ] ; } } } return $ modelClasses ; }
docstring: Return all Model Class names
  
  @return array
docstring_tokens: Return all Model Class names