Skip to content

Commit

Permalink
Merge pull request #2560 from malarzm/last-php-chores
Browse files Browse the repository at this point in the history
Last PHP 8.1 chores
  • Loading branch information
malarzm authored Oct 27, 2023
2 parents d56384d + 0007188 commit 14af2cb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
4 changes: 0 additions & 4 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
<exclude-pattern>tests/Proxies*</exclude-pattern>
<exclude-pattern>tests/Hydrators*</exclude-pattern>
<exclude-pattern>tests/PersistentCollections*</exclude-pattern>
<!-- Figure out what to do with "Scope keyword "static" must be followed by a single space; found newline" -->
<exclude-pattern>tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP80Types.php</exclude-pattern>
<!-- Figure out what to do with PHP 8.1 errors in coding standard -->
<exclude-pattern>tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP81Types.php</exclude-pattern>

<rule ref="Doctrine">
<!-- Traversable type hints often end up as mixed[], so we skip them for now -->
Expand Down
6 changes: 0 additions & 6 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
</errorLevel>
</UndefinedConstant>

<UndefinedAttributeClass>
<errorLevel type="suppress">
<!-- Remove it when using PHP 8.1 for running Psalm -->
<referencedClass name="ReturnTypeWillChange" />
</errorLevel>
</UndefinedAttributeClass>
<InvalidReturnType>
<errorLevel type="suppress">
<!-- Remove it when dropping support for doctrine/collections v1 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
*/
class CollWithPHP80Types extends ArrayCollection
{
public function mixed(mixed $param) : mixed
public function mixed(mixed $param): mixed
{
return $param;
}

/**
* @param Collection<TKey, TElement>|ArrayCollection<TKey, TElement> $param
*
* @return Collection<TKey, TElement>|ArrayCollection<TKey, TElement>
*/
public function union(Collection|ArrayCollection $param) : Collection|ArrayCollection
public function union(Collection|ArrayCollection $param): Collection|ArrayCollection
{
return $param;
}

public function static() : static
public function static(): static
{
return $this;
}

public function nullableStatic() : ?static
public function nullableStatic(): ?static
{
return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
*/
class CollWithPHP81Types extends ArrayCollection
{
/**
* @param Collection<TKey, TElement>&ArrayCollection<TKey, TElement> $param
* @return Collection<TKey, TElement>&ArrayCollection<TKey, TElement>
*/
public function intersection(Collection&ArrayCollection $param) : Collection&ArrayCollection
public function intersection(Collection&ArrayCollection $param): Collection&ArrayCollection
{
return $param;
}

public function never() : never
public function never(): never
{
die('You shall not pass');
}
Expand Down

0 comments on commit 14af2cb

Please sign in to comment.