Server: appserver-7f0f8755-nginx-15961cad18524ec5a9db05f2a6a7e440
Current directory: /code/wp-includes/Requests/src
Software: nginx/1.27.5
Shell Command
Create a new file
Upload file
File: Hooks.php
0 is executed later * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $hook argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $callback argument is not callable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $priority argument is not an integer. */ public function register($hook, $callback, $priority = 0) { if (is_string($hook) === false) { throw InvalidArgument::create(1, '$hook', 'string', gettype($hook)); } if (is_callable($callback) === false) { throw InvalidArgument::create(2, '$callback', 'callable', gettype($callback)); } if (InputValidator::is_numeric_array_key($priority) === false) { throw InvalidArgument::create(3, '$priority', 'integer', gettype($priority)); } if (!isset($this->hooks[$hook])) { $this->hooks[$hook] = [ $priority => [], ]; } elseif (!isset($this->hooks[$hook][$priority])) { $this->hooks[$hook][$priority] = []; } $this->hooks[$hook][$priority][] = $callback; } /** * Dispatch a message * * @param string $hook Hook name * @param array $parameters Parameters to pass to callbacks * @return boolean Successfulness * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $hook argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $parameters argument is not an array. */ public function dispatch($hook, $parameters = []) { if (is_string($hook) === false) { throw InvalidArgument::create(1, '$hook', 'string', gettype($hook)); } // Check strictly against array, as Array* objects don't work in combination with `call_user_func_array()`. if (is_array($parameters) === false) { throw InvalidArgument::create(2, '$parameters', 'array', gettype($parameters)); } if (empty($this->hooks[$hook])) { return false; } if (!empty($parameters)) { // Strip potential keys from the array to prevent them being interpreted as parameter names in PHP 8.0. $parameters = array_values($parameters); } ksort($this->hooks[$hook]); foreach ($this->hooks[$hook] as $priority => $hooked) { foreach ($hooked as $callback) { $callback(...$parameters); } } return true; } public function __wakeup() { throw new \LogicException( __CLASS__ . ' should never be unserialized' ); } }
.
24 Items
Change directory
Remove directory
Rename directory
..
2 Items
Change directory
Remove directory
Rename directory
Auth
1 Items
Change directory
Remove directory
Rename directory
Auth.php
0.84 KB
Edit
Delete
Copy
Move
Remame
Autoload.php
9.12 KB
Edit
Delete
Copy
Move
Remame
Capability.php
0.64 KB
Edit
Delete
Copy
Move
Remame
Cookie
1 Items
Change directory
Remove directory
Rename directory
Cookie.php
15.03 KB
Edit
Delete
Copy
Move
Remame
Exception
6 Items
Change directory
Remove directory
Rename directory
Exception.php
1.09 KB
Edit
Delete
Copy
Move
Remame
HookManager.php
0.69 KB
Edit
Delete
Copy
Move
Remame
Hooks.php
2.96 KB
Edit
Delete
Copy
Move
Remame
IdnaEncoder.php
12.14 KB
Edit
Delete
Copy
Move
Remame
Ipv6.php
5.51 KB
Edit
Delete
Copy
Move
Remame
Iri.php
28.93 KB
Edit
Delete
Copy
Move
Remame
Port.php
1.47 KB
Edit
Delete
Copy
Move
Remame
Proxy
1 Items
Change directory
Remove directory
Rename directory
Proxy.php
0.85 KB
Edit
Delete
Copy
Move
Remame
Requests.php
33.2 KB
Edit
Delete
Copy
Move
Remame
Response
1 Items
Change directory
Remove directory
Rename directory
Response.php
4.18 KB
Edit
Delete
Copy
Move
Remame
Session.php
8.89 KB
Edit
Delete
Copy
Move
Remame
Ssl.php
5.3 KB
Edit
Delete
Copy
Move
Remame
Transport
2 Items
Change directory
Remove directory
Rename directory
Transport.php
1.51 KB
Edit
Delete
Copy
Move
Remame
Utility
3 Items
Change directory
Remove directory
Rename directory