Skip to content

Commit

Permalink
Upgrade and run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeniau committed Jul 29, 2024
1 parent d18ce59 commit 8c5caf9
Show file tree
Hide file tree
Showing 23 changed files with 329 additions and 289 deletions.
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"plugins": ["@prettier/plugin-php"],
"phpVersion": "8.1",
"singleQuote": true,
"trailingCommaPHP": true
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"dependencies": {
"@prettier/plugin-php": "^0.19.7",
"@prettier/plugin-php": "^0.22.2",
"husky": "^3.0.5",
"lint-staged": "^9.4.0",
"prettier": "^1.18.2"
"prettier": "^3.3.3"
},
"scripts": {
"phpstan": "vendor/bin/phpstan analyse src/ -c phpstan.neon",
Expand Down
32 changes: 6 additions & 26 deletions src/Collection/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
/**
* @template E
* @template ExtraProperty
*
*
* @implements \IteratorAggregate<E>
* @implements \ArrayAccess<int, E>
*/
class Collection implements
\IteratorAggregate,
\Serializable,
\Countable,
\ArrayAccess
class Collection implements \IteratorAggregate, \Serializable, \Countable, \ArrayAccess
{
/**
* The elements of the collection.
Expand All @@ -40,7 +36,7 @@ class Collection implements
*/
public function __construct(
array $elements = [],
array $extraProperties = []
array $extraProperties = [],
) {
$this->elements = $elements;
$this->extraProperties = $extraProperties;
Expand All @@ -55,8 +51,6 @@ public function __serialize(): array
}

/**
* {@inheritdoc}
*
* @param string $values
*/
public function __unserialize($values): void
Expand All @@ -70,7 +64,7 @@ public function __unserialize($values): void

/**
* Returns inner elements collection.
*
*
* @return array<E>
*/
public function toArray(): array
Expand All @@ -79,8 +73,6 @@ public function toArray(): array
}

/**
* {@inheritdoc}
*
* @deprecated `serialize` method is deprecated, `__serialize` is used instead. See https://php.watch/versions/8.1/serializable-deprecated
*/
public function serialize(): string
Expand All @@ -96,9 +88,6 @@ public function unserialize($data): void
$this->__unserialize($data);
}

/**
* {@inheritdoc}
*/
public function count(): int
{
return count($this->elements);
Expand All @@ -113,10 +102,8 @@ public function getTotalItems(): int
}

/**
* {@inheritdoc}
*
* @param mixed|null $offset
* @param mixed $value
*
* @phpstan-param E $value
*/
public function offsetSet($offset, $value): void
Expand All @@ -129,8 +116,6 @@ public function offsetSet($offset, $value): void
}

/**
* {@inheritdoc}
*
* @param mixed|null $offset
*/
public function offsetExists($offset): bool
Expand All @@ -139,8 +124,6 @@ public function offsetExists($offset): bool
}

/**
* {@inheritdoc}
*
* @param mixed|null $offset
*/
public function offsetUnset($offset): void
Expand All @@ -149,11 +132,10 @@ public function offsetUnset($offset): void
}

/**
* {@inheritdoc}
*
* @param mixed|null $offset
*
* @return mixed|null
*
* @phpstan-return E|null
*/
public function offsetGet($offset): mixed
Expand All @@ -162,8 +144,6 @@ public function offsetGet($offset): mixed
}

/**
* {@inheritdoc}
*
* @return \ArrayIterator<int, E>
*/
public function getIterator(): \ArrayIterator
Expand Down
Loading

0 comments on commit 8c5caf9

Please sign in to comment.