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

Drop the usage of assert statements #10285

Open
kaitlinnewson opened this issue Aug 7, 2024 · 1 comment
Open

Drop the usage of assert statements #10285

kaitlinnewson opened this issue Aug 7, 2024 · 1 comment
Labels
Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.

Comments

@kaitlinnewson
Copy link
Member

kaitlinnewson commented Aug 7, 2024

Describe the bug
Follow up of the discussion: #8749

Throughout the classes, there are asserts being used to check for values being set or if an object belongs to a class/type. We should review these and consider removing them or converting them to proper exceptions/type hints where appropriate.

Filing based on feedback received in review of Notes conversion to Eloquent from @jonasraoni: #10268 (comment)

What application are you using?
OJS, OMP or OPS version main

Additional information
Example:

assert($element instanceof \PKP\core\DataObject && !empty($columnId));

Other possible examples to review: https://github.com/search?q=repo%3Apkp%2Fpkp-lib+assert%28%24element&type=code

@jonasraoni
Copy link
Contributor

Linking the discussion: #8749

@jonasraoni jonasraoni changed the title Review use of assert statements in grid Drop the usage of assert statements Aug 7, 2024
@jonasraoni jonasraoni added the Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day. label Aug 7, 2024
@jonasraoni jonasraoni modified the milestone: 3.5 Internal Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.
Projects
None yet
Development

No branches or pull requests

2 participants