swaggest / php-json-schema

High definition PHP structures with JSON-schema based validation
MIT License
451 stars 51 forks source link

Add return types to fix deprecation #152

Closed chen-gloria closed 6 months ago

chen-gloria commented 1 year ago

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

vearutop commented 1 year ago

@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 commented 1 year ago

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

chen-gloria commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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