You are here

interface TinyPngInterface in TinyPNG 8

Interface TinyPngInterface.

@package Drupal\tinypng

Hierarchy

Expanded class hierarchy of TinyPngInterface

All classes that implement TinyPngInterface

1 file declares its use of TinyPngInterface
TinyPngImageStyleDownloadController.php in src/Controller/TinyPngImageStyleDownloadController.php

File

src/TinyPngInterface.php, line 10

Namespace

Drupal\tinypng
View source
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);

}

Members

Namesort descending Modifiers Type Description Overrides
TinyPngInterface::saveTo public function Save result to file. 1
TinyPngInterface::setApiKey public function Set TinyPNG API key. 1
TinyPngInterface::setFromFile public function Compress with \Tinify\fromFile. 1
TinyPngInterface::setFromUrl public function Compress with \Tinify\fromUrl. 1