PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
2.4.7 2.4.6 2.4.5 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 / slim / psr7 / src / Header.php
ameliabooking / vendor / slim / psr7 / src Last commit date
Factory 2 months ago Interfaces 2 months ago Cookies.php 2 months ago Environment.php 2 months ago Header.php 2 months ago Headers.php 2 months ago Message.php 2 months ago NonBufferedBody.php 2 months ago Request.php 2 months ago Response.php 2 months ago Stream.php 2 months ago UploadedFile.php 2 months ago Uri.php 2 months ago
Header.php
97 lines
1 <?php
2
3 /**
4 * Slim Framework (https://slimframework.com)
5 *
6 * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License)
7 */
8
9 declare(strict_types=1);
10
11 namespace Slim\Psr7;
12
13 use InvalidArgumentException;
14
15 use function array_merge;
16 use function is_array;
17 use function is_string;
18
19 class Header
20 {
21 private string $originalName;
22
23 private string $normalizedName;
24
25 private array $values;
26
27 /**
28 * Header constructor.
29 *
30 * @param string $originalName
31 * @param string $normalizedName
32 * @param array $values
33 */
34 public function __construct(string $originalName, string $normalizedName, array $values)
35 {
36 $this->originalName = $originalName;
37 $this->normalizedName = $normalizedName;
38 $this->values = $values;
39 }
40
41 /**
42 * @return string
43 */
44 public function getOriginalName(): string
45 {
46 return $this->originalName;
47 }
48
49 /**
50 * @return string
51 */
52 public function getNormalizedName(): string
53 {
54 return $this->normalizedName;
55 }
56
57 /**
58 * @param string $value
59 *
60 * @return self
61 */
62 public function addValue(string $value): self
63 {
64 $this->values[] = $value;
65
66 return $this;
67 }
68
69 /**
70 * @param array|string $values
71 *
72 * @return self
73 */
74 public function addValues($values): self
75 {
76 if (is_string($values)) {
77 return $this->addValue($values);
78 }
79
80 if (!is_array($values)) {
81 throw new InvalidArgumentException('Parameter 1 of Header::addValues() should be a string or an array.');
82 }
83
84 $this->values = array_merge($this->values, $values);
85
86 return $this;
87 }
88
89 /**
90 * @return array
91 */
92 public function getValues(): array
93 {
94 return $this->values;
95 }
96 }
97