-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add return types to fix deprecation #152
Add return types to fix deprecation #152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@chen-gloria thank you for raising this, seems there is compatibility issue with older versions of PHP (7.4 and below). Which version of PHP did you use to get the log with deprecation? |
And also where does this log come from? Which application or tool? |
Hi~ we are using |
We build a customized RabbitMq based on this project/tool: RabbitMq for communications among our different apps, the difference between the official one and ours is that the official one doesn't use json-schema validation, but we need it, so we use your json-schema to validate our data. Our code is private but pretty similar to the RabbitMq, but we added |
These notices don't come from PHP but Symfony's DebugClassLoader, per the message this PR should just add docblocks so the code remains compatible with PHP 5.4. |
thanks, do you mean like a comment to notify deprecation..? |
@@ -28,13 +28,13 @@ public function &__get($name) | |||
} | |||
|
|||
#[\ReturnTypeWillChange] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so you must now remove #[\ReturnTypeWillChange]
@@ -28,13 +28,13 @@ public function &__get($name) | |||
} | |||
|
|||
#[\ReturnTypeWillChange] | |||
public function offsetExists($offset) | |||
public function offsetExists($offset): bool | |||
{ | |||
return array_key_exists($offset, $this->__arrayOfData); | |||
} | |||
|
|||
#[\ReturnTypeWillChange] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to fix symfony crap messages, add a phpdoc block with @return
One of our bundles is using
"swaggest/json-schema"
and we just came across some deprecation, just some simple fixes to update, hopefully it works (?):