Skip to content

Commit c3bac6b

Browse files
Исправления в оформлении кода
1 parent e3841a4 commit c3bac6b

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/Headers.php

+17-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
*
1313
* Реализует управление заголовками запроса
1414
*/
15-
class Headers implements HeadersInterface {
15+
class Headers implements HeadersInterface
16+
{
1617

1718
/**
1819
* @var array Заголовки
@@ -56,7 +57,8 @@ private function getAllHeaders(): array
5657
/**
5758
* @inheritDoc
5859
*/
59-
public function set(array $params): void {
60+
public function set(array $params): void
61+
{
6062
$this->getAll();
6163

6264
foreach ($params as $header => $value)
@@ -70,7 +72,8 @@ public function set(array $params): void {
7072
/**
7173
* @inheritDoc
7274
*/
73-
public function add(array $params): void {
75+
public function add(array $params): void
76+
{
7477
foreach ($params as $header => $value)
7578
{
7679
$headerExists = array_key_exists($header, $this->headers);
@@ -83,7 +86,8 @@ public function add(array $params): void {
8386
/**
8487
* @inheritDoc
8588
*/
86-
public function remove(string $key): void {
89+
public function remove(string $key): void
90+
{
8791
$this->getAll();
8892

8993
unset($this->headers[$key]);
@@ -93,7 +97,8 @@ public function remove(string $key): void {
9397
/**
9498
* @inheritDoc
9599
*/
96-
public function removeAll(): void {
100+
public function removeAll(): void
101+
{
97102
$this->headers = [];
98103

99104
header_remove();
@@ -102,7 +107,8 @@ public function removeAll(): void {
102107
/**
103108
* @inheritDoc
104109
*/
105-
public function has(string $key): bool {
110+
public function has(string $key): bool
111+
{
106112
$this->getAll();
107113

108114
return array_key_exists($key, $this->headers);
@@ -111,7 +117,8 @@ public function has(string $key): bool {
111117
/**
112118
* @inheritDoc
113119
*/
114-
public function get(string $key): string {
120+
public function get(string $key): string
121+
{
115122
if (!$this->has($key))
116123
{
117124
throw new InvalidArgumentException("Заголоков {$key} отсутсвует.");
@@ -123,9 +130,10 @@ public function get(string $key): string {
123130
/**
124131
* @inheritDoc
125132
*/
126-
public function getAll(): array {
133+
public function getAll(): array
134+
{
127135
$this->headers = !empty($this->headers) ? $this->headers : $this->getAllHeaders();
128136

129137
return $this->headers;
130138
}
131-
}
139+
}

0 commit comments

Comments
 (0)