-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Deprecate OC_JSON
and OCP\JSON
#14129
Conversation
This deprecates – but not removes – those two classes and all functions in it. There is no reason that new developments should use those methods as with the AppFramework there is a replacement that allows testable code. With the `@deprecated` annotation IDEs like PHPStorm will point out to the developer that a functionality is deprecated and that there is a better suited replacement.
The inspection completed: 397 new issues |
Refer to this link for build results (access rights to CI server needed): |
@@ -31,141 +30,142 @@ | |||
namespace OCP; | |||
|
|||
/** | |||
* This class provides convinient functions to generate and send JSON data. Usefull for Ajax calls | |||
* This class provides convenient functions to generate and send JSON data. Useful for Ajax calls | |||
* @deprecated Use a AppFramework JSONResponse instead |
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.
Please specify the time range for public APIs
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.
Well, that would require that we have a consensus on that first. => Out of scope for this PR.
fine with me 👍 |
👍 |
Deprecate `OC_JSON` and `OCP\JSON`
This deprecates – but not removes – those two classes and all functions in it. There is no reason that new developments should use those methods as with the AppFramework there is a replacement that allows testable code (this code uses
exit()
and other anti-patterns that makes testing such code impossible). This change set also corrects some PHPDocs.With the
@deprecated
annotation IDEs like PHPStorm will point out to the developer that a functionality is deprecated and that there is a better suited replacement.cc @DeepDiver1975 @karlitschek