Skip to content

Commit aeedbc7

Browse files
authored
Merge pull request #3 from WyriHaximus-labs/DEVizzent-openapi-31-8.2-deprecations
[openapi v3.1] PHP 8.2 deprecations
2 parents c5a294e + ca5bed0 commit aeedbc7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/json/JsonReference.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function getReference(): string
127127
* which is a value of any type other than a resource.
128128
*/
129129
#[\ReturnTypeWillChange]
130-
public function jsonSerialize() //: mixed
130+
public function jsonSerialize(): mixed
131131
{
132132
return (object)['$ref' => $this->getReference()];
133133
}

src/spec/OpenApi.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function performValidation()
107107
*/
108108
public function getMajorVersion()
109109
{
110-
if (preg_match(static::PATTERN_VERSION, $this->openapi, $matches)) {
110+
if (is_string($this->openapi) && preg_match(static::PATTERN_VERSION, $this->openapi, $matches)) {
111111
switch ($matches[1]) {
112112
case '3.0':
113113
return static::VERSION_3_0;

src/spec/Paths.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function offsetExists($offset): bool
195195
* @return PathItem Can return all value types.
196196
*/
197197
#[\ReturnTypeWillChange]
198-
public function offsetGet($offset) //: mixed
198+
public function offsetGet($offset): mixed
199199
{
200200
return $this->getPath($offset);
201201
}

src/spec/Responses.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function offsetExists($offset): bool
185185
* @return mixed Can return all value types.
186186
*/
187187
#[\ReturnTypeWillChange]
188-
public function offsetGet($offset) //: mixed
188+
public function offsetGet($offset): mixed
189189
{
190190
return $this->getResponse($offset);
191191
}

0 commit comments

Comments
 (0)