original_string: public function load(string $locale):array
      {
          $filename = "{$this->path}/{$locale}.php";
          try {
              $loaded = $this->files->getRequire($filename);
              if (!is_array($loaded)) {
                  throw new InvalidResourceException();
              }
  
              return $loaded;
          } catch (FileNotFoundException $e) {
              throw new NotFoundResourceException("$filename not found.", 0, $e);
          } catch (\Throwable $e) {
              throw new InvalidResourceException("$filename has invalid resources.", 0, $e);
          }
      }
code: public function load(string $locale):array
      {
          $filename = "{$this->path}/{$locale}.php";
          try {
              $loaded = $this->files->getRequire($filename);
              if (!is_array($loaded)) {
                  throw new InvalidResourceException();
              }
  
              return $loaded;
          } catch (FileNotFoundException $e) {
              throw new NotFoundResourceException("$filename not found.", 0, $e);
          } catch (\Throwable $e) {
              throw new InvalidResourceException("$filename has invalid resources.", 0, $e);
          }
      }
code_tokens: public function load ( string $ locale ) : array { $ filename = "{$this->path}/{$locale}.php" ; try { $ loaded = $ this -> files -> getRequire ( $ filename ) ; if ( ! is_array ( $ loaded ) ) { throw new InvalidResourceException ( ) ; } return $ loaded ; } catch ( FileNotFoundException $ e ) { throw new NotFoundResourceException ( "$filename not found." , 0 , $ e ) ; } catch ( \ Throwable $ e ) { throw new InvalidResourceException ( "$filename has invalid resources." , 0 , $ e ) ; } }
docstring: Loads a locale.
  
  @param string $locale A locale
  
  @throws NotFoundResourceException when the resource cannot be found
  @throws InvalidResourceException  when the resource cannot be loaded
  
  @return array
docstring_tokens: Loads a locale .