Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
RequestEvents.php
01 <?php
02 namespace GuzzleHttp\Event;
03
04 /**
05 * Contains methods used to manage the request event lifecycle.
06 */
07 final class RequestEvents
08 {
09 // Generic event priorities
10 const EARLY = 10000;
11 const LATE = -10000;
12
13 // "before" priorities
14 const PREPARE_REQUEST = -100;
15 const SIGN_REQUEST = -10000;
16
17 // "complete" and "error" response priorities
18 const VERIFY_RESPONSE = 100;
19 const REDIRECT_RESPONSE = 200;
20
21 /**
22 * Converts an array of event options into a formatted array of valid event
23 * configuration.
24 *
25 * @param array $options Event array to convert
26 * @param array $events Event names to convert in the options array.
27 * @param mixed $handler Event handler to utilize
28 *
29 * @return array
30 * @throws \InvalidArgumentException if the event config is invalid
31 * @internal
32 */
33 public static function convertEventArray(
34 array $options,
35 array $events,
36 $handler
37 ) {
38 foreach ($events as $name) {
39 if (!isset($options[$name])) {
40 $options[$name] = [$handler];
41 } elseif (is_callable($options[$name])) {
42 $options[$name] = [$options[$name], $handler];
43 } elseif (is_array($options[$name])) {
44 if (isset($options[$name]['fn'])) {
45 $options[$name] = [$options[$name], $handler];
46 } else {
47 $options[$name][] = $handler;
48 }
49 } else {
50 throw new \InvalidArgumentException('Invalid event format');
51 }
52 }
53
54 return $options;
55 }
56 }
57