diff --git a/BigQuery/src/QueryResults.php b/BigQuery/src/QueryResults.php index f09db23e091c..0f37b3b6c295 100644 --- a/BigQuery/src/QueryResults.php +++ b/BigQuery/src/QueryResults.php @@ -352,6 +352,7 @@ public function job() * query completion has been exceeded. * @throws GoogleException Thrown in the case of a malformed response. */ + #[\ReturnTypeWillChange] public function getIterator() { return $this->rows(); diff --git a/Bigtable/src/ChunkFormatter.php b/Bigtable/src/ChunkFormatter.php index db3b923eb650..adb31e7a536f 100644 --- a/Bigtable/src/ChunkFormatter.php +++ b/Bigtable/src/ChunkFormatter.php @@ -490,6 +490,7 @@ private function cellInProgress(CellChunk $chunk) * @return \Generator * @throws BigtableDataOperationException Thrown in the case of a malformed response. */ + #[\ReturnTypeWillChange] public function getIterator() { return $this->readAll(); diff --git a/Bigtable/src/ResumableStream.php b/Bigtable/src/ResumableStream.php index 8230c202ce37..ed1220cf266e 100644 --- a/Bigtable/src/ResumableStream.php +++ b/Bigtable/src/ResumableStream.php @@ -112,6 +112,7 @@ public function readAll() * @return \Generator * @throws ApiException Thrown in the case of a malformed response. */ + #[\ReturnTypeWillChange] public function getIterator() { return $this->readAll(); diff --git a/Core/src/Iterator/ItemIteratorTrait.php b/Core/src/Iterator/ItemIteratorTrait.php index 1236424b25b7..85fc65339c17 100644 --- a/Core/src/Iterator/ItemIteratorTrait.php +++ b/Core/src/Iterator/ItemIteratorTrait.php @@ -74,6 +74,7 @@ public function iterateByPage() * * @return null */ + #[\ReturnTypeWillChange] public function rewind() { $this->pageIndex = 0; @@ -86,6 +87,7 @@ public function rewind() * * @return mixed */ + #[\ReturnTypeWillChange] public function current() { $page = $this->pageIterator->current(); @@ -100,6 +102,7 @@ public function current() * * @return int */ + #[\ReturnTypeWillChange] public function key() { return $this->position; @@ -110,6 +113,7 @@ public function key() * * @return null */ + #[\ReturnTypeWillChange] public function next() { $this->pageIndex++; @@ -126,6 +130,7 @@ public function next() * * @return bool */ + #[\ReturnTypeWillChange] public function valid() { $page = $this->pageIterator->current(); diff --git a/Core/src/Iterator/PageIteratorTrait.php b/Core/src/Iterator/PageIteratorTrait.php index dd0de60356ef..bbf0ff8e1bd6 100644 --- a/Core/src/Iterator/PageIteratorTrait.php +++ b/Core/src/Iterator/PageIteratorTrait.php @@ -146,6 +146,7 @@ public function nextResultToken() * * @return null */ + #[\ReturnTypeWillChange] public function rewind() { $this->itemCount = 0; @@ -169,6 +170,7 @@ public function rewind() * * @return array|null */ + #[\ReturnTypeWillChange] public function current() { if ($this->page === null) { @@ -189,6 +191,7 @@ public function current() * * @return int */ + #[\ReturnTypeWillChange] public function key() { return $this->position; @@ -199,6 +202,7 @@ public function key() * * @return null */ + #[\ReturnTypeWillChange] public function next() { $this->position++; @@ -212,6 +216,7 @@ public function next() * * @return bool */ + #[\ReturnTypeWillChange] public function valid() { if (!$this->page && $this->position) { diff --git a/Core/src/Testing/FileListFilterIterator.php b/Core/src/Testing/FileListFilterIterator.php index 920e8566ecd1..f377c469a3c5 100644 --- a/Core/src/Testing/FileListFilterIterator.php +++ b/Core/src/Testing/FileListFilterIterator.php @@ -62,6 +62,7 @@ public function __construct( * @experimental * @internal */ + #[\ReturnTypeWillChange] public function accept() { /** @var \SplFileInfo */ diff --git a/Core/src/Testing/Snippet/Coverage/ExcludeFilter.php b/Core/src/Testing/Snippet/Coverage/ExcludeFilter.php index 6ca0bce0b65b..4ec41aafd8b0 100644 --- a/Core/src/Testing/Snippet/Coverage/ExcludeFilter.php +++ b/Core/src/Testing/Snippet/Coverage/ExcludeFilter.php @@ -44,6 +44,7 @@ public function __construct(Iterator $iterator, array $excludeDirs) /** * @return bool Determines whether to accept or exclude a path */ + #[\ReturnTypeWillChange] public function accept() { // Accept the current item if we can recurse into it diff --git a/Core/src/Testing/Snippet/Parser/Snippet.php b/Core/src/Testing/Snippet/Parser/Snippet.php index 3499d75d1066..400aa64695da 100644 --- a/Core/src/Testing/Snippet/Parser/Snippet.php +++ b/Core/src/Testing/Snippet/Parser/Snippet.php @@ -291,6 +291,7 @@ public function regexReplace($pattern, $new) * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->config; diff --git a/Datastore/src/DatastoreSessionHandler.php b/Datastore/src/DatastoreSessionHandler.php index 7e8182be6dfc..3e9accfbecde 100644 --- a/Datastore/src/DatastoreSessionHandler.php +++ b/Datastore/src/DatastoreSessionHandler.php @@ -189,6 +189,7 @@ public function __construct( * used here. It will use this value as the Datastore kind. * @return bool */ + #[\ReturnTypeWillChange] public function open($savePath, $sessionName) { $this->kind = $sessionName; @@ -206,6 +207,7 @@ public function open($savePath, $sessionName) /** * Just return true for this implementation. */ + #[\ReturnTypeWillChange] public function close() { return true; @@ -214,6 +216,7 @@ public function close() /** * Read the session data from Cloud Datastore. */ + #[\ReturnTypeWillChange] public function read($id) { try { @@ -243,6 +246,7 @@ public function read($id) * @param string $data The session data to write to the {@see \Google\Cloud\Datastore\Entity}. * @return bool */ + #[\ReturnTypeWillChange] public function write($id, $data) { try { @@ -274,6 +278,7 @@ public function write($id, $data) /** * Delete the session data from Cloud Datastore. */ + #[\ReturnTypeWillChange] public function destroy($id) { try { @@ -297,6 +302,7 @@ public function destroy($id) /** * Delete the old session data from Cloud Datastore. */ + #[\ReturnTypeWillChange] public function gc($maxlifetime) { if ($this->gcLimit === 0) { diff --git a/Datastore/src/Entity.php b/Datastore/src/Entity.php index 70bdeda8fd5a..38c36fadf63e 100644 --- a/Datastore/src/Entity.php +++ b/Datastore/src/Entity.php @@ -113,6 +113,7 @@ class Entity implements ArrayAccess, EntityInterface * @return void * @access private */ + #[\ReturnTypeWillChange] public function offsetSet($key, $val) { $this->entity[$key] = $val; @@ -123,6 +124,7 @@ public function offsetSet($key, $val) * @return bool * @access private */ + #[\ReturnTypeWillChange] public function offsetExists($key) { return isset($this->entity[$key]); @@ -133,6 +135,7 @@ public function offsetExists($key) * @return void * @access private */ + #[\ReturnTypeWillChange] public function offsetUnset($key) { unset($this->entity[$key]); @@ -143,6 +146,7 @@ public function offsetUnset($key) * @return mixed * @access private */ + #[\ReturnTypeWillChange] public function offsetGet($key) { return isset($this->entity[$key]) diff --git a/Datastore/src/EntityPageIterator.php b/Datastore/src/EntityPageIterator.php index ea590ed3b574..0af78d977f97 100644 --- a/Datastore/src/EntityPageIterator.php +++ b/Datastore/src/EntityPageIterator.php @@ -51,6 +51,7 @@ public function moreResultsType() * * @return array|null */ + #[\ReturnTypeWillChange] public function current() { if (!$this->page) { diff --git a/Datastore/src/Key.php b/Datastore/src/Key.php index 930d8fca5f78..778a2e2d2f1f 100644 --- a/Datastore/src/Key.php +++ b/Datastore/src/Key.php @@ -421,6 +421,7 @@ public function keyObject() /** * @access private */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->keyObject(); diff --git a/Datastore/src/Query/GqlQuery.php b/Datastore/src/Query/GqlQuery.php index 8cf7938d306e..91eafc3c6a80 100644 --- a/Datastore/src/Query/GqlQuery.php +++ b/Datastore/src/Query/GqlQuery.php @@ -214,6 +214,7 @@ public function start($cursor) * @access private * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->queryObject(); diff --git a/Datastore/src/Query/Query.php b/Datastore/src/Query/Query.php index 8b7fe70ebc7a..6f67a2d29d82 100644 --- a/Datastore/src/Query/Query.php +++ b/Datastore/src/Query/Query.php @@ -476,6 +476,7 @@ public function queryKey() /** * @access private */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->queryObject(); diff --git a/Datastore/tests/Unit/SampleEntity.php b/Datastore/tests/Unit/SampleEntity.php index 04c0cc1c1567..a2a88f1337ea 100644 --- a/Datastore/tests/Unit/SampleEntity.php +++ b/Datastore/tests/Unit/SampleEntity.php @@ -33,21 +33,25 @@ public static function mappings() ]; } + #[\ReturnTypeWillChange] public function offsetSet($key, $val) { $this->entity[$key] = $val; } + #[\ReturnTypeWillChange] public function offsetExists($key) { return isset($this->entity[$key]); } + #[\ReturnTypeWillChange] public function offsetUnset($key) { unset($this->entity[$key]); } + #[\ReturnTypeWillChange] public function offsetGet($key) { return isset($this->entity[$key]) diff --git a/Debugger/src/MatchingFileIterator.php b/Debugger/src/MatchingFileIterator.php index 992c3dbda1f5..4673586e7454 100644 --- a/Debugger/src/MatchingFileIterator.php +++ b/Debugger/src/MatchingFileIterator.php @@ -62,6 +62,7 @@ public function __construct($searchPath, $file) * @access private * @return boolean */ + #[\ReturnTypeWillChange] public function accept() { $candidate = $this->getInnerIterator()->current(); diff --git a/Firestore/src/DocumentSnapshot.php b/Firestore/src/DocumentSnapshot.php index 9a6d234219cf..0d03e4b92985 100644 --- a/Firestore/src/DocumentSnapshot.php +++ b/Firestore/src/DocumentSnapshot.php @@ -310,6 +310,7 @@ public function get($fieldPath) /** * @access private */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new \BadMethodCallException('DocumentSnapshots are read-only.'); @@ -318,6 +319,7 @@ public function offsetSet($offset, $value) /** * @access private */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return array_key_exists($offset, $this->data); @@ -326,6 +328,7 @@ public function offsetExists($offset) /** * @access private */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { throw new \BadMethodCallException('DocumentSnapshots are read-only.'); @@ -334,6 +337,7 @@ public function offsetUnset($offset) /** * @access private */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { if (!$this->offsetExists($offset)) { diff --git a/Firestore/src/FirestoreSessionHandler.php b/Firestore/src/FirestoreSessionHandler.php index 5d07f40920e2..832a4cd84d50 100644 --- a/Firestore/src/FirestoreSessionHandler.php +++ b/Firestore/src/FirestoreSessionHandler.php @@ -211,6 +211,7 @@ public function __construct( * used in the Firestore collection ID. * @return bool */ + #[\ReturnTypeWillChange] public function open($savePath, $sessionName) { $this->savePath = $savePath; @@ -241,6 +242,7 @@ public function open($savePath, $sessionName) /** * Close the transaction and commit any changes. */ + #[\ReturnTypeWillChange] public function close() { if (is_null($this->transaction)) { @@ -264,6 +266,7 @@ public function close() * @param string $id Identifier used for the session. * @return string */ + #[\ReturnTypeWillChange] public function read($id) { $this->id = $id; @@ -298,6 +301,7 @@ public function read($id) * @param string $data The session data to write to the Firestore document. * @return bool */ + #[\ReturnTypeWillChange] public function write($id, $data) { $docRef = $this->getDocumentReference( @@ -320,6 +324,7 @@ public function write($id, $data) * @param string $id Identifier used for the session * @return bool */ + #[\ReturnTypeWillChange] public function destroy($id) { $docRef = $this->getDocumentReference( @@ -340,6 +345,7 @@ public function destroy($id) * in seconds. * @return int|bool */ + #[\ReturnTypeWillChange] public function gc($maxlifetime) { if (0 === $this->options['gcLimit']) { diff --git a/Firestore/src/QuerySnapshot.php b/Firestore/src/QuerySnapshot.php index 0a73440ab574..d151aea3d1c4 100644 --- a/Firestore/src/QuerySnapshot.php +++ b/Firestore/src/QuerySnapshot.php @@ -112,6 +112,7 @@ public function rows() * @access private * @return \ArrayIterator */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->rows); diff --git a/Spanner/src/Result.php b/Spanner/src/Result.php index 94538825e130..1275f5716722 100644 --- a/Spanner/src/Result.php +++ b/Spanner/src/Result.php @@ -374,6 +374,7 @@ public function transaction() * @access private * @return \Generator */ + #[\ReturnTypeWillChange] public function getIterator() { return $this->rows(); diff --git a/Storage/src/Lifecycle.php b/Storage/src/Lifecycle.php index 168dc5e3250d..66f4ee228025 100644 --- a/Storage/src/Lifecycle.php +++ b/Storage/src/Lifecycle.php @@ -304,6 +304,7 @@ public function clearRules($action = null) * @access private * @return \Generator */ + #[\ReturnTypeWillChange] public function getIterator() { if (!isset($this->lifecycle['rule'])) { @@ -329,6 +330,7 @@ public function toArray() * @param string $offset * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->lifecycle['rule'][$offset] = $value; @@ -339,6 +341,7 @@ public function offsetSet($offset, $value) * @param string $offset * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->lifecycle['rule'][$offset]); @@ -348,6 +351,7 @@ public function offsetExists($offset) * @access private * @param string $offset */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->lifecycle['rule'][$offset]); @@ -358,6 +362,7 @@ public function offsetUnset($offset) * @param string $offset * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->lifecycle['rule'][$offset]) diff --git a/Storage/src/ObjectPageIterator.php b/Storage/src/ObjectPageIterator.php index ecf1b3685f72..3e4e4a00e88b 100644 --- a/Storage/src/ObjectPageIterator.php +++ b/Storage/src/ObjectPageIterator.php @@ -48,6 +48,7 @@ public function prefixes() * * @return array|null */ + #[\ReturnTypeWillChange] public function current() { if (!$this->page) { diff --git a/Trace/src/Attributes.php b/Trace/src/Attributes.php index 98e0815d6cb6..df75b6b8b9e3 100644 --- a/Trace/src/Attributes.php +++ b/Trace/src/Attributes.php @@ -51,6 +51,7 @@ class Attributes implements \ArrayAccess * @param string $offset * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->attributes[$offset] = $value; @@ -62,6 +63,7 @@ public function offsetSet($offset, $value) * @access private * @param string $offset */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->attributes[$offset]); @@ -73,6 +75,7 @@ public function offsetExists($offset) * @access private * @param string $offset */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->attributes[$offset]); @@ -84,6 +87,7 @@ public function offsetUnset($offset) * @access private * @param string $offset */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->attributes[$offset])