Debian Codegraph @

includes/libs/NonSerializableTrait.php

raw symbols SCIP
1 <?php
2
3 namespace Wikimedia\NonSerializable;
4
5 use LogicException;
6
7 /**
8 * A trait that prevents serialization via php's builtin serialize() function.
9 */
10 trait NonSerializableTrait {
11
12 /**
13 * @throws LogicException always
14 * @return never
15 */
16 public function __sleep() {
17 throw new LogicException( 'Instances of ' . get_class( $this ) . ' are not serializable!' );
18 }
19
20 }