Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Add return types to fix deprecation #152

wants to merge 1 commit into from

Conversation

chen-gloria
Copy link

@chen-gloria chen-gloria commented Aug 1, 2023

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 (?):
Screenshot from 2023-08-01 14-51-49

Copy link

@dominicchinkh dominicchinkh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vearutop
Copy link
Member

vearutop commented Aug 1, 2023

@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?

@vearutop
Copy link
Member

vearutop commented Aug 1, 2023

And also where does this log come from? Which application or tool?

@chen-gloria
Copy link
Author

@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?

Hi~ we are using "php": "~7.3 || 8.0.* || 8.1.*".

@chen-gloria
Copy link
Author

And also where does this log come from? Which application or tool?

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 "swaggest/json-schema" for json-schema validation.

@cs278
Copy link

cs278 commented Aug 4, 2023

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.

@chen-gloria
Copy link
Author

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]
Copy link
Contributor

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]
Copy link
Contributor

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

@chen-gloria chen-gloria closed this by deleting the head repository May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants