original_string: private static function loadDefinitionsFromPath(string $path): array
      {
          if (!\file_exists($path)) {
              throw new \RuntimeException(\sprintf('Path "%s" does not exist', $path));
          }
  
          if (!\is_dir($path)) {
              return self::loadDefinitionsFromFile($path);
          }
  
          $definitions = [];
          foreach (\glob($path . '/*.php', \GLOB_ERR) as $file) {
              if (\is_file($file)) {
                  $definitions[] = self::loadDefinitionsFromFile($file);
              }
          }
  
          return \count($definitions) === 0 ? [] : \array_merge(...$definitions);
      }
code: private static function loadDefinitionsFromPath(string $path): array
      {
          if (!\file_exists($path)) {
              throw new \RuntimeException(\sprintf('Path "%s" does not exist', $path));
          }
  
          if (!\is_dir($path)) {
              return self::loadDefinitionsFromFile($path);
          }
  
          $definitions = [];
          foreach (\glob($path . '/*.php', \GLOB_ERR) as $file) {
              if (\is_file($file)) {
                  $definitions[] = self::loadDefinitionsFromFile($file);
              }
          }
  
          return \count($definitions) === 0 ? [] : \array_merge(...$definitions);
      }
code_tokens: private static function loadDefinitionsFromPath ( string $ path ) : array { if ( ! \ file_exists ( $ path ) ) { throw new \ RuntimeException ( \ sprintf ( 'Path "%s" does not exist' , $ path ) ) ; } if ( ! \ is_dir ( $ path ) ) { return self :: loadDefinitionsFromFile ( $ path ) ; } $ definitions = [ ] ; foreach ( \ glob ( $ path . '/*.php' , \ GLOB_ERR ) as $ file ) { if ( \ is_file ( $ file ) ) { $ definitions [ ] = self :: loadDefinitionsFromFile ( $ file ) ; } } return \ count ( $ definitions ) === 0 ? [ ] : \ array_merge ( ... $ definitions ) ; }
docstring: Load definitions from path.
  
  @param string $path
  
  @throws \RuntimeException
  
  @return array
docstring_tokens: Load definitions from path .