Skip to content

Commit 95628d0

Browse files
Fix PHP 8.1 tentative return types (#3)
* Fix PHP8.1 tentative return types Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> * Enable E_ALL error reporting on CI Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent 75f941c commit 95628d0

File tree

19 files changed

+72
-1
lines changed

19 files changed

+72
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
uses: shivammathur/setup-php@v2
2525
with:
2626
php-version: ${{ matrix.php }}
27+
ini-values: error_reporting=E_ALL
2728
tools: composer:v2
2829
coverage: pcov
2930

lib/Horde/Imap/Client/Base.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ abstract class Horde_Imap_Client_Base
232232
* DEFAULT: 30 seconds
233233
* - username: (string) [REQUIRED] The username.
234234
* - authusername (string) The username used for SASL authentication.
235-
* If specified this is the user name whose password is used
235+
* If specified this is the user name whose password is used
236236
* (e.g. administrator).
237237
* Only valid for RFC 2595/4616 - PLAIN SASL mechanism.
238238
* DEFAULT: the same value provided in the username parameter.
@@ -346,6 +346,7 @@ public function __clone()
346346

347347
/**
348348
*/
349+
#[ReturnTypeWillChange]
349350
public function update(SplSubject $subject)
350351
{
351352
if (($subject instanceof Horde_Imap_Client_Data_Capability) ||

lib/Horde/Imap/Client/Base/Alerts.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function getLast()
7373

7474
/**
7575
*/
76+
#[ReturnTypeWillChange]
7677
public function attach(SplObserver $observer)
7778
{
7879
$this->detach($observer);
@@ -81,6 +82,7 @@ public function attach(SplObserver $observer)
8182

8283
/**
8384
*/
85+
#[ReturnTypeWillChange]
8486
public function detach(SplObserver $observer)
8587
{
8688
if (($key = array_search($observer, $this->_observers, true)) !== false) {
@@ -92,6 +94,7 @@ public function detach(SplObserver $observer)
9294
* Notification is triggered internally whenever the object's internal
9395
* data storage is altered.
9496
*/
97+
#[ReturnTypeWillChange]
9598
public function notify()
9699
{
97100
foreach ($this->_observers as $val) {

lib/Horde/Imap/Client/Data/Acl.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,23 @@ protected function _normalize()
100100

101101
/**
102102
*/
103+
#[ReturnTypeWillChange]
103104
public function offsetExists($offset)
104105
{
105106
return $this[$offset];
106107
}
107108

108109
/**
109110
*/
111+
#[ReturnTypeWillChange]
110112
public function offsetGet($offset)
111113
{
112114
return in_array($offset, $this->_rights);
113115
}
114116

115117
/**
116118
*/
119+
#[ReturnTypeWillChange]
117120
public function offsetSet($offset, $value)
118121
{
119122
if ($value) {
@@ -133,13 +136,15 @@ public function offsetSet($offset, $value)
133136

134137
/**
135138
*/
139+
#[ReturnTypeWillChange]
136140
public function offsetUnset($offset)
137141
{
138142
$this->_rights = array_values(array_diff($this->_rights, array($offset)));
139143
}
140144

141145
/* IteratorAggregate method. */
142146

147+
#[ReturnTypeWillChange]
143148
public function getIterator()
144149
{
145150
return new ArrayIterator($this->_rights);

lib/Horde/Imap/Client/Data/AclRights.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ protected function _normalize()
9494

9595
/**
9696
*/
97+
#[ReturnTypeWillChange]
9798
public function offsetExists($offset)
9899
{
99100
return (bool)$this[$offset];
100101
}
101102

102103
/**
103104
*/
105+
#[ReturnTypeWillChange]
104106
public function offsetGet($offset)
105107
{
106108
if (isset($this->_optional[$offset])) {
@@ -116,6 +118,7 @@ public function offsetGet($offset)
116118

117119
/**
118120
*/
121+
#[ReturnTypeWillChange]
119122
public function offsetSet($offset, $value)
120123
{
121124
$this->_optional[$offset] = $value;
@@ -124,6 +127,7 @@ public function offsetSet($offset, $value)
124127

125128
/**
126129
*/
130+
#[ReturnTypeWillChange]
127131
public function offsetUnset($offset)
128132
{
129133
unset($this->_optional[$offset]);
@@ -140,6 +144,7 @@ public function offsetUnset($offset)
140144

141145
/**
142146
*/
147+
#[ReturnTypeWillChange]
143148
public function current()
144149
{
145150
$val = current($this->_required);
@@ -150,6 +155,7 @@ public function current()
150155

151156
/**
152157
*/
158+
#[ReturnTypeWillChange]
153159
public function key()
154160
{
155161
$key = key($this->_required);
@@ -160,6 +166,7 @@ public function key()
160166

161167
/**
162168
*/
169+
#[ReturnTypeWillChange]
163170
public function next()
164171
{
165172
if (key($this->_required) === null) {
@@ -171,6 +178,7 @@ public function next()
171178

172179
/**
173180
*/
181+
#[ReturnTypeWillChange]
174182
public function rewind()
175183
{
176184
reset($this->_required);
@@ -179,6 +187,7 @@ public function rewind()
179187

180188
/**
181189
*/
190+
#[ReturnTypeWillChange]
182191
public function valid()
183192
{
184193
return ((key($this->_required) !== null) ||

lib/Horde/Imap/Client/Data/Capability.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public function toArray()
169169

170170
/**
171171
*/
172+
#[ReturnTypeWillChange]
172173
public function attach(SplObserver $observer)
173174
{
174175
$this->detach($observer);
@@ -177,6 +178,7 @@ public function attach(SplObserver $observer)
177178

178179
/**
179180
*/
181+
#[ReturnTypeWillChange]
180182
public function detach(SplObserver $observer)
181183
{
182184
if (($key = array_search($observer, $this->_observers, true)) !== false) {
@@ -188,6 +190,7 @@ public function detach(SplObserver $observer)
188190
* Notification is triggered internally whenever the object's internal
189191
* data storage is altered.
190192
*/
193+
#[ReturnTypeWillChange]
191194
public function notify()
192195
{
193196
foreach ($this->_observers as $val) {

lib/Horde/Imap/Client/Data/Format/Filter/Quote.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Horde_Imap_Client_Data_Format_Filter_Quote extends php_user_filter
3131

3232
/**
3333
*/
34+
#[ReturnTypeWillChange]
3435
public function onCreate()
3536
{
3637
$this->_prepend = false;
@@ -39,6 +40,7 @@ public function onCreate()
3940
/**
4041
* @see stream_filter_register()
4142
*/
43+
#[ReturnTypeWillChange]
4244
public function filter($in, $out, &$consumed, $closing)
4345
{
4446
if (!$this->_prepend) {

lib/Horde/Imap/Client/Data/Format/Filter/String.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Horde_Imap_Client_Data_Format_Filter_String extends php_user_filter
3333
/**
3434
* @see stream_filter_register()
3535
*/
36+
#[ReturnTypeWillChange]
3637
public function onCreate()
3738
{
3839
$this->params->binary = false;
@@ -47,6 +48,7 @@ public function onCreate()
4748
/**
4849
* @see stream_filter_register()
4950
*/
51+
#[ReturnTypeWillChange]
5052
public function filter($in, $out, &$consumed, $closing)
5153
{
5254
$p = $this->params;

lib/Horde/Imap/Client/Data/Format/List.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function __toString()
8888

8989
/**
9090
*/
91+
#[ReturnTypeWillChange]
9192
public function count()
9293
{
9394
return count($this->_data);
@@ -98,6 +99,7 @@ public function count()
9899
/**
99100
* Iterator loops through the data elements contained in this list.
100101
*/
102+
#[ReturnTypeWillChange]
101103
public function getIterator()
102104
{
103105
return new ArrayIterator($this->_data);

lib/Horde/Imap/Client/Data/SearchCharset.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public function setValid($charset, $valid = true)
133133

134134
/**
135135
*/
136+
#[ReturnTypeWillChange]
136137
public function attach(SplObserver $observer)
137138
{
138139
$this->detach($observer);
@@ -141,6 +142,7 @@ public function attach(SplObserver $observer)
141142

142143
/**
143144
*/
145+
#[ReturnTypeWillChange]
144146
public function detach(SplObserver $observer)
145147
{
146148
if (($key = array_search($observer, $this->_observers, true)) !== false) {
@@ -152,6 +154,7 @@ public function detach(SplObserver $observer)
152154
* Notification is triggered internally whenever the object's internal
153155
* data storage is altered.
154156
*/
157+
#[ReturnTypeWillChange]
155158
public function notify()
156159
{
157160
foreach ($this->_observers as $val) {

0 commit comments

Comments
 (0)