| 1 | <?php |
||
| 14 | class BlackHole |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Constructor |
||
| 18 | * |
||
| 19 | * @see https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor |
||
| 20 | * |
||
| 21 | * @return void |
||
|
1 ignored issue
–
show
|
|||
| 22 | */ |
||
| 23 | 15 | public function __construct() |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Destructor |
||
| 30 | * |
||
| 31 | * @see https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.destructor |
||
| 32 | * |
||
| 33 | * @return void |
||
| 34 | */ |
||
| 35 | 15 | public function __destruct() |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Get class property (magic method) |
||
| 42 | * |
||
| 43 | * @see https://www.php.net/manual/en/language.oop5.overloading.php#object.get |
||
| 44 | * |
||
| 45 | * @param string $name Property to retrieve |
||
| 46 | * @return mixed The BlackHole instance so it can be chained. |
||
| 47 | */ |
||
| 48 | 2 | public function __get($name) |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Set class property (magic method) |
||
| 55 | * |
||
| 56 | * @see https://www.php.net/manual/en/language.oop5.overloading.php#object.set |
||
| 57 | * |
||
| 58 | * @param string $name Property to set |
||
| 59 | * @param mixed $value Value to set property to |
||
| 60 | * @return void |
||
| 61 | */ |
||
| 62 | 3 | public function __set($name, $value) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * Unset class property (magic method) |
||
| 69 | * |
||
| 70 | * @see https://www.php.net/manual/en/language.oop5.overloading.php#object.isset |
||
| 71 | * |
||
| 72 | * @param string $name Property to check |
||
| 73 | * @return bool Always true |
||
| 74 | */ |
||
| 75 | 2 | public function __isset($name) |
|
| 79 | |||
| 80 | /** |
||
| 81 | * Unset class property (magic method) |
||
| 82 | * |
||
| 83 | * @see https://www.php.net/manual/en/language.oop5.overloading.php#object.unset |
||
| 84 | * |
||
| 85 | * @param string $name Property to unset |
||
| 86 | * @return void |
||
| 87 | */ |
||
| 88 | 2 | public function __unset($name) |
|
| 92 | |||
| 93 | /** |
||
| 94 | * Call specific class method in object context (magic method) |
||
| 95 | * |
||
| 96 | * @see https://www.php.net/manual/en/language.oop5.overloading.php#object.call |
||
| 97 | * |
||
| 98 | * @param string $name Method to call |
||
| 99 | * @param mixed[] $arguments Enumerated array of method parameters |
||
| 100 | * @return mixed The BlackHole instance so it can be chained. |
||
| 101 | */ |
||
| 102 | 2 | public function __call($name, $arguments) |
|
| 106 | |||
| 107 | /** |
||
| 108 | * Call specific class method in static context (magic method) |
||
| 109 | * |
||
| 110 | * @see https://www.php.net/manual/en/language.oop5.overloading.php#object.callstatic |
||
| 111 | * |
||
| 112 | * @param string $name Method to call |
||
| 113 | * @param mixed[] $arguments Enumerated array of method parameters |
||
| 114 | * @return mixed A new BlackHole instance so it can be chained. |
||
| 115 | */ |
||
| 116 | 2 | public static function __callStatic($name, $arguments) |
|
| 120 | |||
| 121 | /** |
||
| 122 | * Serialize class to string (magic method) |
||
| 123 | * |
||
| 124 | * @see https://www.php.net/manual/en/language.oop5.magic.php#object.tostring |
||
| 125 | * |
||
| 126 | * @return string The fully qualified class name for the object |
||
| 127 | */ |
||
| 128 | public function __toString() |
||
| 132 | |||
| 133 | /** |
||
| 134 | * Serialize class to array (magic method) |
||
| 135 | * |
||
| 136 | * @see https://www.php.net/manual/en/language.oop5.magic.php#object.serialize |
||
| 137 | * |
||
| 138 | * @return mixed Associative array of key-value pairs as object representation |
||
| 139 | */ |
||
| 140 | 1 | public function __serialize() |
|
| 144 | |||
| 145 | /** |
||
| 146 | * Unserialize array of class properties (magic method) |
||
| 147 | * |
||
| 148 | * @see https://www.php.net/manual/en/function.unserialize.php |
||
| 149 | * |
||
| 150 | * @param mixed[] $data Properties to unserialize back into the class |
||
| 151 | * @return void |
||
| 152 | */ |
||
| 153 | 1 | public function __unserialize(array $data) |
|
| 157 | |||
| 158 | /** |
||
| 159 | * Call object as a function (magic method) |
||
| 160 | * |
||
| 161 | * @see https://www.php.net/manual/en/language.oop5.magic.php#object.invoke |
||
| 162 | * |
||
| 163 | * @return string The BlackHole instance so it can be chained. |
||
| 164 | */ |
||
| 165 | 2 | public function __invoke() |
|
| 169 | |||
| 170 | /** |
||
| 171 | * Override object representation for {@see \var_export()} (magic method) |
||
| 172 | * |
||
| 173 | * @see https://www.php.net/manual/en/language.oop5.magic.php#object.set-state |
||
| 174 | * |
||
| 175 | * @param mixed[] $properties Associative array of exported properties |
||
| 176 | * @return object A new BlackHole instance so it can be chained. |
||
| 177 | */ |
||
| 178 | 2 | public static function __set_state($properties) |
|
| 182 | |||
| 183 | /** |
||
| 184 | * Override object representation for {@see \var_dump()} (magic method) |
||
| 185 | * |
||
| 186 | * @see https://www.php.net/manual/en/language.oop5.magic.php#object.debuginfo |
||
| 187 | * |
||
| 188 | * @return mixed[] No debug information |
||
| 189 | */ |
||
| 190 | 2 | public function __debugInfo() |
|
| 194 | } |
||
| 195 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.