Skip to content

Commit dbf43a6

Browse files
committed
Drop Psalm
As per our decision during the hackathon
1 parent 51fef27 commit dbf43a6

12 files changed

+82
-149
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77
phpunit.xml.dist export-ignore
88
/phpcs.xml.dist export-ignore
99
/phpstan.neon.dist export-ignore
10-
/psalm.xml.dist export-ignore

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
"doctrine/coding-standard": "^12",
4242
"phpstan/phpstan": "^1.8",
4343
"phpstan/phpstan-phpunit": "^1.0",
44-
"phpunit/phpunit": "^10.5",
45-
"vimeo/psalm": "^5.11"
44+
"phpunit/phpunit": "^10.5"
4645
},
4746
"autoload": {
4847
"psr-4": {

psalm.xml.dist

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/AbstractLazyCollection.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
/**
1313
* Lazy collection that is backed by a concrete collection
1414
*
15-
* @psalm-template TKey of array-key
16-
* @psalm-template T
15+
* @phpstan-template TKey of array-key
16+
* @phpstan-template T
1717
* @template-implements Collection<TKey,T>
1818
*/
1919
abstract class AbstractLazyCollection implements Collection
2020
{
2121
/**
2222
* The backed collection to use
2323
*
24-
* @psalm-var Collection<TKey,T>|null
24+
* @phpstan-var Collection<TKey,T>|null
2525
* @var Collection<mixed>|null
2626
*/
2727
protected Collection|null $collection;
@@ -305,7 +305,7 @@ public function slice(int $offset, int|null $length = null)
305305
* {@inheritDoc}
306306
*
307307
* @return Traversable<int|string, mixed>
308-
* @psalm-return Traversable<TKey,T>
308+
* @phpstan-return Traversable<TKey,T>
309309
*/
310310
#[ReturnTypeWillChange]
311311
public function getIterator()
@@ -377,7 +377,7 @@ public function offsetUnset(mixed $offset)
377377
*
378378
* @return bool
379379
*
380-
* @psalm-assert-if-true Collection<TKey,T> $this->collection
380+
* @phpstan-assert-if-true Collection<TKey,T> $this->collection
381381
*/
382382
public function isInitialized()
383383
{
@@ -389,7 +389,7 @@ public function isInitialized()
389389
*
390390
* @return void
391391
*
392-
* @psalm-assert Collection<TKey,T> $this->collection
392+
* @phpstan-assert Collection<TKey,T> $this->collection
393393
*/
394394
protected function initialize()
395395
{

src/ArrayCollection.php

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@
4040
* serialize a collection use {@link toArray()} and reconstruct the collection
4141
* manually.
4242
*
43-
* @psalm-template TKey of array-key
44-
* @psalm-template T
43+
* @phpstan-template TKey of array-key
44+
* @phpstan-template T
4545
* @template-implements Collection<TKey,T>
4646
* @template-implements Selectable<TKey,T>
47-
* @psalm-consistent-constructor
47+
* @phpstan-consistent-constructor
4848
*/
4949
class ArrayCollection implements Collection, Selectable, Stringable
5050
{
5151
/**
5252
* An array containing the entries of this collection.
5353
*
54-
* @psalm-var array<TKey,T>
54+
* @phpstan-var array<TKey,T>
5555
* @var mixed[]
5656
*/
5757
private array $elements = [];
5858

5959
/**
6060
* Initializes a new ArrayCollection.
6161
*
62-
* @psalm-param array<TKey,T> $elements
62+
* @phpstan-param array<TKey,T> $elements
6363
*/
6464
public function __construct(array $elements = [])
6565
{
@@ -89,13 +89,13 @@ public function first()
8989
* instance should be created when constructor semantics have changed.
9090
*
9191
* @param array $elements Elements.
92-
* @psalm-param array<K,V> $elements
92+
* @phpstan-param array<K,V> $elements
9393
*
9494
* @return static
95-
* @psalm-return static<K,V>
95+
* @phpstan-return static<K,V>
9696
*
97-
* @psalm-template K of array-key
98-
* @psalm-template V
97+
* @phpstan-template K of array-key
98+
* @phpstan-template V
9999
*/
100100
protected function createFrom(array $elements)
101101
{
@@ -257,10 +257,10 @@ public function exists(Closure $p)
257257
/**
258258
* {@inheritDoc}
259259
*
260-
* @psalm-param TMaybeContained $element
260+
* @phpstan-param TMaybeContained $element
261261
*
262262
* @return int|string|false
263-
* @psalm-return (TMaybeContained is T ? TKey|false : false)
263+
* @phpstan-return (TMaybeContained is T ? TKey|false : false)
264264
*
265265
* @template TMaybeContained
266266
*/
@@ -315,8 +315,6 @@ public function set(string|int $key, mixed $value)
315315
/**
316316
* {@inheritDoc}
317317
*
318-
* @psalm-suppress InvalidPropertyAssignmentValue
319-
*
320318
* This breaks assumptions about the template type, but it would
321319
* be a backwards-incompatible change to remove this method
322320
*/
@@ -337,7 +335,7 @@ public function isEmpty()
337335
* {@inheritDoc}
338336
*
339337
* @return Traversable<int|string, mixed>
340-
* @psalm-return Traversable<TKey, T>
338+
* @phpstan-return Traversable<TKey, T>
341339
*/
342340
#[ReturnTypeWillChange]
343341
public function getIterator()
@@ -348,12 +346,12 @@ public function getIterator()
348346
/**
349347
* {@inheritDoc}
350348
*
351-
* @psalm-param Closure(T):U $func
349+
* @phpstan-param Closure(T):U $func
352350
*
353351
* @return static
354-
* @psalm-return static<TKey, U>
352+
* @phpstan-return static<TKey, U>
355353
*
356-
* @psalm-template U
354+
* @phpstan-template U
357355
*/
358356
public function map(Closure $func)
359357
{
@@ -371,10 +369,10 @@ public function reduce(Closure $func, $initial = null)
371369
/**
372370
* {@inheritDoc}
373371
*
374-
* @psalm-param Closure(T, TKey):bool $p
372+
* @phpstan-param Closure(T, TKey):bool $p
375373
*
376374
* @return static
377-
* @psalm-return static<TKey,T>
375+
* @phpstan-return static<TKey,T>
378376
*/
379377
public function filter(Closure $p)
380378
{
@@ -455,7 +453,7 @@ public function slice(int $offset, int|null $length = null)
455453
return array_slice($this->elements, $offset, $length, true);
456454
}
457455

458-
/** @psalm-return Collection<TKey, T>&Selectable<TKey,T> */
456+
/** @phpstan-return Collection<TKey, T>&Selectable<TKey,T> */
459457
public function matching(Criteria $criteria)
460458
{
461459
$expr = $criteria->getWhereExpression();

src/Collection.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* position unless you explicitly positioned it before. Prefer iteration with
2525
* external iterators.
2626
*
27-
* @psalm-template TKey of array-key
28-
* @psalm-template T
27+
* @phpstan-template TKey of array-key
28+
* @phpstan-template T
2929
* @template-extends ReadableCollection<TKey, T>
3030
* @template-extends ArrayAccess<TKey, T>
3131
*/
@@ -35,7 +35,7 @@ interface Collection extends ReadableCollection, ArrayAccess
3535
* Adds an element at the end of the collection.
3636
*
3737
* @param mixed $element The element to add.
38-
* @psalm-param T $element
38+
* @phpstan-param T $element
3939
*
4040
* @return void we will require a native return type declaration in 3.0
4141
*/
@@ -52,18 +52,18 @@ public function clear();
5252
* Removes the element at the specified index from the collection.
5353
*
5454
* @param string|int $key The key/index of the element to remove.
55-
* @psalm-param TKey $key
55+
* @phpstan-param TKey $key
5656
*
5757
* @return mixed The removed element or NULL, if the collection did not contain the element.
58-
* @psalm-return T|null
58+
* @phpstan-return T|null
5959
*/
6060
public function remove(string|int $key);
6161

6262
/**
6363
* Removes the specified element from the collection, if it is found.
6464
*
6565
* @param mixed $element The element to remove.
66-
* @psalm-param T $element
66+
* @phpstan-param T $element
6767
*
6868
* @return bool TRUE if this collection contained the specified element, FALSE otherwise.
6969
*/
@@ -74,8 +74,8 @@ public function removeElement(mixed $element);
7474
*
7575
* @param string|int $key The key/index of the element to set.
7676
* @param mixed $value The element to set.
77-
* @psalm-param TKey $key
78-
* @psalm-param T $value
77+
* @phpstan-param TKey $key
78+
* @phpstan-param T $value
7979
*
8080
* @return void
8181
*/
@@ -84,34 +84,34 @@ public function set(string|int $key, mixed $value);
8484
/**
8585
* {@inheritDoc}
8686
*
87-
* @psalm-param Closure(T):U $func
87+
* @phpstan-param Closure(T):U $func
8888
*
8989
* @return Collection<mixed>
90-
* @psalm-return Collection<TKey, U>
90+
* @phpstan-return Collection<TKey, U>
9191
*
92-
* @psalm-template U
92+
* @phpstan-template U
9393
*/
9494
public function map(Closure $func);
9595

9696
/**
9797
* {@inheritDoc}
9898
*
99-
* @psalm-param Closure(T, TKey):bool $p
99+
* @phpstan-param Closure(T, TKey):bool $p
100100
*
101101
* @return Collection<mixed> A collection with the results of the filter operation.
102-
* @psalm-return Collection<TKey, T>
102+
* @phpstan-return Collection<TKey, T>
103103
*/
104104
public function filter(Closure $p);
105105

106106
/**
107107
* {@inheritDoc}
108108
*
109-
* @psalm-param Closure(TKey, T):bool $p
109+
* @phpstan-param Closure(TKey, T):bool $p
110110
*
111111
* @return Collection<mixed>[] An array with two elements. The first element contains the collection
112112
* of elements where the predicate returned TRUE, the second element
113113
* contains the collection of elements where the predicate returned FALSE.
114-
* @psalm-return array{0: Collection<TKey, T>, 1: Collection<TKey, T>}
114+
* @phpstan-return array{0: Collection<TKey, T>, 1: Collection<TKey, T>}
115115
*/
116116
public function partition(Closure $p);
117117
}

src/Criteria.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* Criteria for filtering Selectable collections.
1717
*
18-
* @psalm-consistent-constructor
18+
* @phpstan-consistent-constructor
1919
*/
2020
class Criteria
2121
{

0 commit comments

Comments
 (0)