Skip to content

Commit 3613f4c

Browse files
wilsongebrianteemanHLeithner
authored
Notes for return type changes (#73)
* Notes for return type changes * Update docs/code-migration/44-50/removed-backward-incompatibility.md Co-authored-by: Brian Teeman <[email protected]> * Moved to the right version, added changed methods --------- Co-authored-by: Brian Teeman <[email protected]> Co-authored-by: Harald <[email protected]>
1 parent d4bbfba commit 3613f4c

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

migrations/44-50/removed-backward-incompatibility.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,41 @@ class MyModel extends ListModel {
3737

3838
### CSS removals
3939
The CSS class ".ie11" was removed [via PR #39018](https://github.com/joomla/joomla-cms/pull/39018)
40+
41+
42+
### Return Types
43+
All return types have been updated to match the PHP 8.1 return type signatures. This addresses any class utilising the ArrayAccess, Datetime or the JsonSerializable interfaces. If you extend from any of the affected classes and require compatibility with both Joomla 4.x and 5.x you should add the `#[\ReturnTypeWillChange]` annotation to your code.
44+
45+
#### administrator/components/com_users/src/DataShape/DataShapeObject.php
46+
47+
```php
48+
public function __isset(...) --> public function __isset(...): bool
49+
public function offsetExists(...) --> public function offsetExists(...): bool
50+
public function offsetGet(...) --> public function offsetGet(...): mixed
51+
public function offsetSet(...) --> public function offsetSet(...): void
52+
public function offsetUnset(...) --> public function offsetUnset(...): void
53+
```
54+
55+
#### libraries/src/Date/Date.php
56+
57+
```php
58+
public function format(...) --> public function format(...): string
59+
public function setTimezone(...) --> public function setTimezone(...): \Datetime
60+
```
61+
62+
#### libraries/src/Document/JsonapiDocument.php
63+
64+
```php
65+
public function jsonSerialize(...) --> public function jsonSerialize(...): mixed
66+
```
67+
68+
#### libraries/src/Feed/Feed.php
69+
70+
```php
71+
public function count(...) --> public function count(...): int
72+
public function offsetExists(...) --> public function offsetExists(...): bool
73+
public function offsetGet(...) --> public function offsetGet(...): mixed
74+
public function offsetSet(...) --> public function offsetSet(...): void
75+
public function offsetUnset(...) --> public function offsetUnset(...): void
76+
```
77+

0 commit comments

Comments
 (0)