You are here

public function SerializationStopperTrait::__sleep in Flysystem 8

Same name and namespace in other branches
  1. 3.x src/SerializationStopperTrait.php \Drupal\flysystem\SerializationStopperTrait::__sleep()
  2. 2.0.x src/SerializationStopperTrait.php \Drupal\flysystem\SerializationStopperTrait::__sleep()
  3. 3.0.x src/SerializationStopperTrait.php \Drupal\flysystem\SerializationStopperTrait::__sleep()

Prevents the class from being serialized.

File

src/SerializationStopperTrait.php, line 13

Class

SerializationStopperTrait
Stops a class from being serialized.

Namespace

Drupal\flysystem

Code

public function __sleep() {
  $message = sprintf('%s can not be serialized. This probably means you are serializing an object that has an indirect reference to the %s object. Adjust your code so that is not necessary.', __CLASS__, __CLASS__);
  throw new \LogicException($message);
}