PluginProbe
Elementor Website Builder – more than just a page builder / 3.25.1
Elementor Website Builder – more than just a page builder v3.25.1
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
elementor / vendor_prefixed / laravel / serializable-closure / src / UnsignedSerializableClosure.php

UnsignedSerializableClosure.php in Elementor Website Builder – more than just a page builder 3.25.1, at vendor_prefixed/laravel/serializable-closure/src/UnsignedSerializableClosure.php

72 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ElementorDeps\Laravel\SerializableClosure;
4
5 use Closure;
6 use ElementorDeps\Laravel\SerializableClosure\Exceptions\PhpVersionNotSupportedException;
7 class UnsignedSerializableClosure
8 {
9 /**
10 * The closure's serializable.
11 *
12 * @var \Laravel\SerializableClosure\Contracts\Serializable
13 */
14 protected $serializable;
15 /**
16 * Creates a new serializable closure instance.
17 *
18 * @param \Closure $closure
19 * @return void
20 */
21 public function __construct(Closure $closure)
22 {
23 if (\PHP_VERSION_ID < 70400) {
24 throw new PhpVersionNotSupportedException();
25 }
26 $this->serializable = new Serializers\Native($closure);
27 }
28 /**
29 * Resolve the closure with the given arguments.
30 *
31 * @return mixed
32 */
33 public function __invoke()
34 {
35 if (\PHP_VERSION_ID < 70400) {
36 throw new PhpVersionNotSupportedException();
37 }
38 return \call_user_func_array($this->serializable, \func_get_args());
39 }
40 /**
41 * Gets the closure.
42 *
43 * @return \Closure
44 */
45 public function getClosure()
46 {
47 if (\PHP_VERSION_ID < 70400) {
48 throw new PhpVersionNotSupportedException();
49 }
50 return $this->serializable->getClosure();
51 }
52 /**
53 * Get the serializable representation of the closure.
54 *
55 * @return array
56 */
57 public function __serialize()
58 {
59 return ['serializable' => $this->serializable];
60 }
61 /**
62 * Restore the closure after serialization.
63 *
64 * @param array $data
65 * @return void
66 */
67 public function __unserialize($data)
68 {
69 $this->serializable = $data['serializable'];
70 }
71 }
72