PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.4
Booking for Appointments and Events Calendar – Amelia v2.4.4
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / rmccue / requests / src / Port.php
ameliabooking / vendor / rmccue / requests / src Last commit date
Auth 5 months ago Cookie 5 months ago Exception 5 months ago Proxy 5 months ago Response 5 months ago Transport 5 months ago Utility 5 months ago Auth.php 5 months ago Autoload.php 5 months ago Capability.php 5 months ago Cookie.php 5 months ago Exception.php 5 months ago HookManager.php 5 months ago Hooks.php 5 months ago IdnaEncoder.php 5 months ago Ipv6.php 5 months ago Iri.php 5 months ago Port.php 5 months ago Proxy.php 5 months ago Requests.php 5 months ago Response.php 5 months ago Session.php 5 months ago Ssl.php 5 months ago Transport.php 5 months ago
Port.php
76 lines
1 <?php
2 /**
3 * Port utilities for AmeliaVendor_Requests
4 *
5 * @package Requests\Utilities
6 * @since 2.0.0
7 */
8
9 namespace AmeliaVendor\WpOrg\Requests;
10
11 use AmeliaVendor\WpOrg\Requests\Exception;
12 use AmeliaVendor\WpOrg\Requests\Exception\InvalidArgument;
13
14 /**
15 * Find the correct port depending on the Request type.
16 *
17 * @package Requests\Utilities
18 * @since 2.0.0
19 */
20 final class Port {
21
22 /**
23 * Port to use with Acap requests.
24 *
25 * @var int
26 */
27 const ACAP = 674;
28
29 /**
30 * Port to use with Dictionary requests.
31 *
32 * @var int
33 */
34 const DICT = 2628;
35
36 /**
37 * Port to use with HTTP requests.
38 *
39 * @var int
40 */
41 const HTTP = 80;
42
43 /**
44 * Port to use with HTTP over SSL requests.
45 *
46 * @var int
47 */
48 const HTTPS = 443;
49
50 /**
51 * Retrieve the port number to use.
52 *
53 * @param string $type Request type.
54 * The following requests types are supported:
55 * 'acap', 'dict', 'http' and 'https'.
56 *
57 * @return int
58 *
59 * @throws \AmeliaVendor\WpOrg\Requests\Exception\InvalidArgument When a non-string input has been passed.
60 * @throws \AmeliaVendor\WpOrg\Requests\Exception When a non-supported port is requested ('portnotsupported').
61 */
62 public static function get($type) {
63 if (!is_string($type)) {
64 throw InvalidArgument::create(1, '$type', 'string', gettype($type));
65 }
66
67 $type = strtoupper($type);
68 if (!defined("self::{$type}")) {
69 $message = sprintf('Invalid port type (%s) passed', $type);
70 throw new Exception($message, 'portnotsupported');
71 }
72
73 return constant("self::{$type}");
74 }
75 }
76