PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.5.1
Defender Security – Malware Scanner, Login Security & Firewall v5.5.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / thecodingmachine / safe / generated / spl.php

spl.php in Defender Security – Malware Scanner, Login Security & Firewall 5.5.1, at vendor/thecodingmachine/safe/generated/spl.php

140 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\SplException;
6
7 /**
8 * This function returns an array with the names of the interfaces that the
9 * given class and its parents implement.
10 *
11 * @param mixed $class An object (class instance) or a string (class or interface name).
12 * @param bool $autoload Whether to allow this function to load the class automatically through
13 * the __autoload magic method.
14 * @return array An array on success.
15 * @throws SplException
16 *
17 */
18 function class_implements($class, bool $autoload = true): array
19 {
20 error_clear_last();
21 $result = \class_implements($class, $autoload);
22 if ($result === false) {
23 throw SplException::createFromPhpError();
24 }
25 return $result;
26 }
27
28
29 /**
30 * This function returns an array with the name of the parent classes of
31 * the given class.
32 *
33 * @param mixed $class An object (class instance) or a string (class name).
34 * @param bool $autoload Whether to allow this function to load the class automatically through
35 * the __autoload magic method.
36 * @return array An array on success.
37 * @throws SplException
38 *
39 */
40 function class_parents($class, bool $autoload = true): array
41 {
42 error_clear_last();
43 $result = \class_parents($class, $autoload);
44 if ($result === false) {
45 throw SplException::createFromPhpError();
46 }
47 return $result;
48 }
49
50
51 /**
52 * This function returns an array with the names of the traits that the
53 * given class uses. This does however not include
54 * any traits used by a parent class.
55 *
56 * @param mixed $class An object (class instance) or a string (class name).
57 * @param bool $autoload Whether to allow this function to load the class automatically through
58 * the __autoload magic method.
59 * @return array An array on success.
60 * @throws SplException
61 *
62 */
63 function class_uses($class, bool $autoload = true): array
64 {
65 error_clear_last();
66 $result = \class_uses($class, $autoload);
67 if ($result === false) {
68 throw SplException::createFromPhpError();
69 }
70 return $result;
71 }
72
73
74 /**
75 * Register a function with the spl provided __autoload queue. If the queue
76 * is not yet activated it will be activated.
77 *
78 * If your code has an existing __autoload function then
79 * this function must be explicitly registered on the __autoload queue. This
80 * is because spl_autoload_register will effectively
81 * replace the engine cache for the __autoload function
82 * by either spl_autoload or
83 * spl_autoload_call.
84 *
85 * If there must be multiple autoload functions, spl_autoload_register
86 * allows for this. It effectively creates a queue of autoload functions, and
87 * runs through each of them in the order they are defined. By contrast,
88 * __autoload may only be defined once.
89 *
90 * @param callable(string):void $autoload_function The autoload function being registered.
91 * If no parameter is provided, then the default implementation of
92 * spl_autoload will be registered.
93 * @param bool $throw This parameter specifies whether
94 * spl_autoload_register should throw
95 * exceptions when the autoload_function
96 * cannot be registered.
97 * @param bool $prepend If true, spl_autoload_register will prepend
98 * the autoloader on the autoload queue instead of appending it.
99 * @throws SplException
100 *
101 */
102 function spl_autoload_register(callable $autoload_function = null, bool $throw = true, bool $prepend = false): void
103 {
104 error_clear_last();
105 if ($prepend !== false) {
106 $result = \spl_autoload_register($autoload_function, $throw, $prepend);
107 } elseif ($throw !== true) {
108 $result = \spl_autoload_register($autoload_function, $throw);
109 } elseif ($autoload_function !== null) {
110 $result = \spl_autoload_register($autoload_function);
111 } else {
112 $result = \spl_autoload_register();
113 }
114 if ($result === false) {
115 throw SplException::createFromPhpError();
116 }
117 }
118
119
120 /**
121 * Removes a function from the autoload queue. If the queue
122 * is activated and empty after removing the given function then it will
123 * be deactivated.
124 *
125 * When this function results in the queue being deactivated, any
126 * __autoload function that previously existed will not be reactivated.
127 *
128 * @param mixed $autoload_function The autoload function being unregistered.
129 * @throws SplException
130 *
131 */
132 function spl_autoload_unregister($autoload_function): void
133 {
134 error_clear_last();
135 $result = \spl_autoload_unregister($autoload_function);
136 if ($result === false) {
137 throw SplException::createFromPhpError();
138 }
139 }
140