original_string: public static function arrayToFile($array, $file)
      {
          self::createDirectory($file);
  
          $lastError = JsonLastError::check();
  
          $json = json_encode($lastError ? $lastError : $array, JSON_PRETTY_PRINT);
  
          self::saveFile($file, $json);
  
          return is_null($lastError);
      }
code: public static function arrayToFile($array, $file)
      {
          self::createDirectory($file);
  
          $lastError = JsonLastError::check();
  
          $json = json_encode($lastError ? $lastError : $array, JSON_PRETTY_PRINT);
  
          self::saveFile($file, $json);
  
          return is_null($lastError);
      }
code_tokens: public static function arrayToFile ( $ array , $ file ) { self :: createDirectory ( $ file ) ; $ lastError = JsonLastError :: check ( ) ; $ json = json_encode ( $ lastError ? $ lastError : $ array , JSON_PRETTY_PRINT ) ; self :: saveFile ( $ file , $ json ) ; return is_null ( $ lastError ) ; }
docstring: Creating JSON file from array.
  
  @param array  $array → array to be converted to JSON
  @param string $file  → path to the file
  
  @return boolean → true if the file is created without errors
docstring_tokens: Creating JSON file from array .