You are here

TinyPngInterface.php in TinyPNG 8

Namespace

Drupal\tinypng

File

src/TinyPngInterface.php
View source
<?php

namespace Drupal\tinypng;


/**
 * Interface TinyPngInterface.
 *
 * @package Drupal\tinypng
 */
interface TinyPngInterface {

  /**
   * Set TinyPNG API key.
   *
   * @param string $key
   *   TinyPNG API key.
   * @param bool $reset
   *   Force to update previous API key.
   *
   * @return $this
   *   Current instance.
   */
  public function setApiKey($key = NULL, $reset = FALSE);

  /**
   * Compress with \Tinify\fromUrl.
   *
   * @param string $url
   *   URI of image file.
   *
   * @return $this
   *   Current instance.
   */
  public function setFromUrl($url);

  /**
   * Compress with \Tinify\fromFile.
   *
   * @param string $uri
   *   URI of file.
   *
   * @return $this
   *   Current instance.
   */
  public function setFromFile($uri);

  /**
   * Save result to file.
   *
   * @param string $uri
   *   Destination URI.
   *
   * @return bool|int
   *   Size of new file.
   */
  public function saveTo($uri);

}

Interfaces

Namesort descending Description
TinyPngInterface Interface TinyPngInterface.