code: public static function write($filename, $buffer)
    {
      $fs = new Filesystem();
      
      try {
        $fs->dumpFile($filename, $buffer);
      }
      catch(IOExceptionInterface $e){
        throw new Exception($e->getMessage());
      }
      
      return true;
    }
docs: Write contents to a file
  
  @param   string    $filename    The full file path
  @param   string    $buffer      The buffer to write
  @return   boolean   True on success
  @throws   Exception