You are here

trait SerializationStopperTrait in Flysystem 8

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

Stops a class from being serialized.

Hierarchy

1 file declares its use of SerializationStopperTrait
SerializationStopperTraitTest.php in tests/src/Unit/SerializationStopperTraitTest.php

File

src/SerializationStopperTrait.php, line 8

Namespace

Drupal\flysystem
View source
trait SerializationStopperTrait {

  /**
   * Prevents the class from being serialized.
   */
  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);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SerializationStopperTrait::__sleep public function Prevents the class from being serialized.