Update git submodules
[mediawiki.git] / includes / libs / NonSerializableTrait.php
blob547d92a594ced6a793232ae1d7ecdd5668d587e0
1 <?php
3 namespace Wikimedia\NonSerializable;
5 use LogicException;
7 /**
8 * A trait that prevents serialization via php's builtin serialize() function.
9 */
10 trait NonSerializableTrait {
12 /**
13 * @throws LogicException always
14 * @return never
16 public function __sleep() {
17 throw new LogicException( 'Instances of ' . get_class( $this ) . ' are not serializable!' );