summaryrefslogtreecommitdiff
path: root/vendor/doctrine/collections/UPGRADE.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/collections/UPGRADE.md')
-rw-r--r--vendor/doctrine/collections/UPGRADE.md112
1 files changed, 112 insertions, 0 deletions
diff --git a/vendor/doctrine/collections/UPGRADE.md b/vendor/doctrine/collections/UPGRADE.md
new file mode 100644
index 0000000..44232f7
--- /dev/null
+++ b/vendor/doctrine/collections/UPGRADE.md
@@ -0,0 +1,112 @@
1Note about upgrading: Doctrine uses static and runtime mechanisms to raise
2awareness about deprecated code.
3
4- Use of `@deprecated` docblock that is detected by IDEs (like PHPStorm) or
5 Static Analysis tools (like Psalm, phpstan)
6- Use of our low-overhead runtime deprecation API, details:
7 https://github.com/doctrine/deprecations/
8
9# Upgrade to 2.2
10
11## Deprecated string representation of sort order
12
13Criteria orderings direction is now represented by the
14`Doctrine\Common\Collection\Order` enum.
15
16As a consequence:
17
18- `Criteria::ASC` and `Criteria::DESC` are deprecated in favor of
19 `Order::Ascending` and `Order::Descending`, respectively.
20- `Criteria::getOrderings()` is deprecated in favor of `Criteria::orderings()`,
21 which returns `array<string, Order>`.
22- `Criteria::orderBy()` accepts `array<string, string|Order>`, but passing
23 anything other than `array<string, Order>` is deprecated.
24
25# Upgrade to 2.0
26
27## BC breaking changes
28
29Native parameter types were added. Native return types will be added in 3.0.x
30As a consequence, some signatures were changed and will have to be adjusted in sub-classes.
31
32Note that in order to keep compatibility with both 1.x and 2.x versions,
33extending code would have to omit the added parameter types.
34This would only work in PHP 7.2+ which is the first version featuring
35[parameter widening](https://wiki.php.net/rfc/parameter-no-type-variance).
36It is also recommended to add return types according to the tables below
37
38You can find a list of major changes to public API below.
39
40### Doctrine\Common\Collections\Collection
41
42| 1.0.x | 3.0.x |
43|---------------------------------:|:-------------------------------------------------|
44| `add($element)` | `add(mixed $element): void` |
45| `clear()` | `clear(): void` |
46| `contains($element)` | `contains(mixed $element): bool` |
47| `isEmpty()` | `isEmpty(): bool` |
48| `removeElement($element)` | `removeElement(mixed $element): bool` |
49| `containsKey($key)` | `containsKey(string\|int $key): bool` |
50| `get()` | `get(string\|int $key): mixed` |
51| `getKeys()` | `getKeys(): array` |
52| `getValues()` | `getValues(): array` |
53| `set($key, $value)` | `set(string\|int $key, $value): void` |
54| `toArray()` | `toArray(): array` |
55| `first()` | `first(): mixed` |
56| `last()` | `last(): mixed` |
57| `key()` | `key(): int\|string\|null` |
58| `current()` | `current(): mixed` |
59| `next()` | `next(): mixed` |
60| `exists(Closure $p)` | `exists(Closure $p): bool` |
61| `filter(Closure $p)` | `filter(Closure $p): self` |
62| `forAll(Closure $p)` | `forAll(Closure $p): bool` |
63| `map(Closure $func)` | `map(Closure $func): self` |
64| `partition(Closure $p)` | `partition(Closure $p): array` |
65| `indexOf($element)` | `indexOf(mixed $element): int\|string\|false` |
66| `slice($offset, $length = null)` | `slice(int $offset, ?int $length = null): array` |
67| `count()` | `count(): int` |
68| `getIterator()` | `getIterator(): \Traversable` |
69| `offsetSet($offset, $value)` | `offsetSet(mixed $offset, mixed $value): void` |
70| `offsetUnset($offset)` | `offsetUnset(mixed $offset): void` |
71| `offsetExists($offset)` | `offsetExists(mixed $offset): bool` |
72
73### Doctrine\Common\Collections\AbstractLazyCollection
74
75| 1.0.x | 3.0.x |
76|------------------:|:------------------------|
77| `isInitialized()` | `isInitialized(): bool` |
78| `initialize()` | `initialize(): void` |
79| `doInitialize()` | `doInitialize(): void` |
80
81### Doctrine\Common\Collections\ArrayCollection
82
83| 1.0.x | 3.0.x |
84|------------------------------:|:--------------------------------------|
85| `createFrom(array $elements)` | `createFrom(array $elements): static` |
86| `__toString()` | `__toString(): string` |
87
88### Doctrine\Common\Collections\Criteria
89
90| 1.0.x | 3.0.x |
91|------------------------------------------:|:--------------------------------------------|
92| `where(Expression $expression): self` | `where(Expression $expression): static` |
93| `andWhere(Expression $expression): self` | `andWhere(Expression $expression): static` |
94| `orWhere(Expression $expression): self` | `orWhere(Expression $expression): static` |
95| `orderBy(array $orderings): self` | `orderBy(array $orderings): static` |
96| `setFirstResult(?int $firstResult): self` | `setFirstResult(?int $firstResult): static` |
97| `setMaxResult(?int $maxResults): self` | `setMaxResults(?int $maxResults): static` |
98
99### Doctrine\Common\Collections\Selectable
100
101| 1.0.x | 3.0.x |
102|-------------------------------:|:-------------------------------------------|
103| `matching(Criteria $criteria)` | `matching(Criteria $criteria): Collection` |
104
105# Upgrade to 1.7
106
107## Deprecated null first result
108
109Passing null as `$firstResult` to
110`Doctrine\Common\Collections\Criteria::__construct()` and to
111`Doctrine\Common\Collections\Criteria::setFirstResult()` is deprecated.
112Use `0` instead.