original_string: public function getModules($requestModule)
      {
          $modules = [];
          $domains = $this->route->getDomains();
          if (count($domains)) {
              foreach ($domains as $module => $info) {
                  try {
                      $module = preg_replace('/(@|\/)/', '', $module);
                      if ($module === $requestModule && !preg_match('/^ROOT/i', $module)) {
                          $modules = [
                              'name' => $module,
                              'path' => dirname($info['base'] . DIRECTORY_SEPARATOR . '..'),
                          ];
                      }
                  } catch (\Exception $e) {
                      $modules[] = $e->getMessage();
                  }
              }
          }
  
          return $modules;
      }
code: public function getModules($requestModule)
      {
          $modules = [];
          $domains = $this->route->getDomains();
          if (count($domains)) {
              foreach ($domains as $module => $info) {
                  try {
                      $module = preg_replace('/(@|\/)/', '', $module);
                      if ($module === $requestModule && !preg_match('/^ROOT/i', $module)) {
                          $modules = [
                              'name' => $module,
                              'path' => dirname($info['base'] . DIRECTORY_SEPARATOR . '..'),
                          ];
                      }
                  } catch (\Exception $e) {
                      $modules[] = $e->getMessage();
                  }
              }
          }
  
          return $modules;
      }
code_tokens: public function getModules ( $ requestModule ) { $ modules = [ ] ; $ domains = $ this -> route -> getDomains ( ) ; if ( count ( $ domains ) ) { foreach ( $ domains as $ module => $ info ) { try { $ module = preg_replace ( '/(@|\/)/' , '' , $ module ) ; if ( $ module === $ requestModule && ! preg_match ( '/^ROOT/i' , $ module ) ) { $ modules = [ 'name' => $ module , 'path' => dirname ( $ info [ 'base' ] . DIRECTORY_SEPARATOR . '..' ) , ] ; } } catch ( \ Exception $ e ) { $ modules [ ] = $ e -> getMessage ( ) ; } } } return $ modules ; }
docstring: Method that extract all modules
  @param string $requestModule
  @return array
docstring_tokens: Method that extract all modules