code: protected function getDirFiles($searchDir)
      {
          // Error state is handled by the excpetion, warning disabled
          $files = @scandir($searchDir, SCANDIR_SORT_NONE);
          if ($files === false) {
              throw new \RuntimeException("Cannot list directory contents: {$searchDir}.");
          }
  
          return array_diff($files, array('..', '.'));
      }
docs: Gets directory files
  
  @param string $searchDir Searched directory
  @return array File names
  @throws \RuntimeException On read error