Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663

This commit is contained in:
Greg Anderson 2015-10-08 11:40:12 -07:00
parent eb34d130a8
commit f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions

View file

@ -32,11 +32,11 @@ abstract class ImageToolkitBase extends PluginBase implements ImageToolkitInterf
protected $configFactory;
/**
* Image object this toolkit instance is tied to.
* Path of the image file.
*
* @var \Drupal\Core\Image\ImageInterface
* @var string
*/
protected $image;
protected $source = '';
/**
* The image toolkit operation manager.
@ -84,18 +84,22 @@ abstract class ImageToolkitBase extends PluginBase implements ImageToolkitInterf
/**
* {@inheritdoc}
*/
public function setImage(ImageInterface $image) {
if ($this->image) {
public function setSource($source) {
// If a previous image has been loaded, there is no way to know if the
// toolkit implementation needs to perform any additional actions like
// freeing memory. Therefore, the source image cannot be changed once set.
if ($this->source) {
throw new \BadMethodCallException(__METHOD__ . '() may only be called once');
}
$this->image = $image;
$this->source = $source;
return $this;
}
/**
* {@inheritdoc}
*/
public function getImage() {
return $this->image;
public function getSource() {
return $this->source;
}
/**

View file

@ -53,23 +53,27 @@ use Drupal\Component\Plugin\PluginInspectionInterface;
interface ImageToolkitInterface extends ContainerFactoryPluginInterface, PluginInspectionInterface, PluginFormInterface {
/**
* Sets the image object that this toolkit instance is tied to.
* Sets the source path of the image file.
*
* @param \Drupal\Core\Image\ImageInterface $image
* The image that this toolkit instance will be tied to.
* @param string $source
* The source path of the image file.
*
* @return \Drupal\Core\ImageToolkit\ImageToolkitInterface
* An instance of the current toolkit object.
*
* @throws \BadMethodCallException
* When called twice.
* After being set initially, the source image cannot be changed.
*/
public function setImage(ImageInterface $image);
public function setSource($source);
/**
* Gets the image object that this toolkit instance is tied to.
* Gets the source path of the image file.
*
* @return \Drupal\Core\Image\ImageInterface
* The image object that this toolkit instance is tied to.
* @return string
* The source path of the image file, or an empty string if the source is
* not set.
*/
public function getImage();
public function getSource();
/**
* Checks if the image is valid.