PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 1.4.9
Backup Migration v1.4.9
2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / analyst / src / Core / AbstractFactory.php
backup-backup / analyst / src / Core Last commit date
AbstractFactory.php 11 months ago
AbstractFactory.php
28 lines
1 <?php
2
3 namespace Analyst\Core;
4
5 abstract class AbstractFactory
6 {
7 /**
8 * Unserialize to static::class instance
9 *
10 * @param $raw
11 * @return static
12 */
13 protected static function unserialize($raw)
14 {
15 $instance = maybe_unserialize($raw);
16
17 $isProperObject = is_object($instance) && $instance instanceof static;
18
19 // In case for some reason unserialized object is not
20 // static::class we make sure it is static::class
21 if (!$isProperObject) {
22 $instance = new static();
23 }
24
25 return $instance;
26 }
27 }
28