Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8c5caf9

Browse files
committedJul 29, 2024·
Upgrade and run prettier
1 parent d18ce59 commit 8c5caf9

23 files changed

+329
-289
lines changed
 

‎.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"plugins": ["@prettier/plugin-php"],
23
"phpVersion": "8.1",
34
"singleQuote": true,
45
"trailingCommaPHP": true

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"dependencies": {
3-
"@prettier/plugin-php": "^0.19.7",
3+
"@prettier/plugin-php": "^0.22.2",
44
"husky": "^3.0.5",
55
"lint-staged": "^9.4.0",
6-
"prettier": "^1.18.2"
6+
"prettier": "^3.3.3"
77
},
88
"scripts": {
99
"phpstan": "vendor/bin/phpstan analyse src/ -c phpstan.neon",

‎src/Collection/Collection.php

+6-26
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@
77
/**
88
* @template E
99
* @template ExtraProperty
10-
*
10+
*
1111
* @implements \IteratorAggregate<E>
1212
* @implements \ArrayAccess<int, E>
1313
*/
14-
class Collection implements
15-
\IteratorAggregate,
16-
\Serializable,
17-
\Countable,
18-
\ArrayAccess
14+
class Collection implements \IteratorAggregate, \Serializable, \Countable, \ArrayAccess
1915
{
2016
/**
2117
* The elements of the collection.
@@ -40,7 +36,7 @@ class Collection implements
4036
*/
4137
public function __construct(
4238
array $elements = [],
43-
array $extraProperties = []
39+
array $extraProperties = [],
4440
) {
4541
$this->elements = $elements;
4642
$this->extraProperties = $extraProperties;
@@ -55,8 +51,6 @@ public function __serialize(): array
5551
}
5652

5753
/**
58-
* {@inheritdoc}
59-
*
6054
* @param string $values
6155
*/
6256
public function __unserialize($values): void
@@ -70,7 +64,7 @@ public function __unserialize($values): void
7064

7165
/**
7266
* Returns inner elements collection.
73-
*
67+
*
7468
* @return array<E>
7569
*/
7670
public function toArray(): array
@@ -79,8 +73,6 @@ public function toArray(): array
7973
}
8074

8175
/**
82-
* {@inheritdoc}
83-
*
8476
* @deprecated `serialize` method is deprecated, `__serialize` is used instead. See https://php.watch/versions/8.1/serializable-deprecated
8577
*/
8678
public function serialize(): string
@@ -96,9 +88,6 @@ public function unserialize($data): void
9688
$this->__unserialize($data);
9789
}
9890

99-
/**
100-
* {@inheritdoc}
101-
*/
10291
public function count(): int
10392
{
10493
return count($this->elements);
@@ -113,10 +102,8 @@ public function getTotalItems(): int
113102
}
114103

115104
/**
116-
* {@inheritdoc}
117-
*
118105
* @param mixed|null $offset
119-
* @param mixed $value
106+
*
120107
* @phpstan-param E $value
121108
*/
122109
public function offsetSet($offset, $value): void
@@ -129,8 +116,6 @@ public function offsetSet($offset, $value): void
129116
}
130117

131118
/**
132-
* {@inheritdoc}
133-
*
134119
* @param mixed|null $offset
135120
*/
136121
public function offsetExists($offset): bool
@@ -139,8 +124,6 @@ public function offsetExists($offset): bool
139124
}
140125

141126
/**
142-
* {@inheritdoc}
143-
*
144127
* @param mixed|null $offset
145128
*/
146129
public function offsetUnset($offset): void
@@ -149,11 +132,10 @@ public function offsetUnset($offset): void
149132
}
150133

151134
/**
152-
* {@inheritdoc}
153-
*
154135
* @param mixed|null $offset
155136
*
156137
* @return mixed|null
138+
*
157139
* @phpstan-return E|null
158140
*/
159141
public function offsetGet($offset): mixed
@@ -162,8 +144,6 @@ public function offsetGet($offset): mixed
162144
}
163145

164146
/**
165-
* {@inheritdoc}
166-
*
167147
* @return \ArrayIterator<int, E>
168148
*/
169149
public function getIterator(): \ArrayIterator

0 commit comments

Comments
 (0)
Please sign in to comment.