code: private function getJsonFile($filename)
      {
          if (!is_readable($filename)) {
              return [];
          }
  
          $contents = json_decode(file_get_contents($filename), true);
  
          return $contents ?: [];
      }
docs: Load the passed file and decode it.
  
  @param string $filename The file name.
  
  @return array