code: private function fetchTemplatesFromResourceDirectories($templateBaseName)
      {
          $allTemplates = [];
          $themeName    = $this->getNoThemeMessage();
          // Add the module templates folders if they exist.
          foreach ($this->resourceDirs as $resourceDir) {
              $allTemplates = array_replace_recursive(
                  $allTemplates,
                  $this->getTemplatesForBaseFrom($templateBaseName, $resourceDir . '/templates', $themeName)
              );
          }
  
          return $allTemplates;
      }
docs: Fetch the templates from resource locations.
  
  @param string $templateBaseName The base name for the templates to retrieve.
  
  @return array