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

Consistently use NULL as "empty" return type rather than FALSE. #32

Open
maikelRAOW opened this issue Jun 18, 2021 · 2 comments
Open

Consistently use NULL as "empty" return type rather than FALSE. #32

maikelRAOW opened this issue Jun 18, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@maikelRAOW
Copy link
Contributor

maikelRAOW commented Jun 18, 2021

One such example is "getParent". In PostModel it will return null if no parent is set, but in TermModel it will return false if no parent is set. I think it would be better to stick with null over false as "empty" type to avoid type mixing.

However, this change has potential to cause issues in existing projects.

@maikelRAOW maikelRAOW added the enhancement New feature or request label Jun 18, 2021
@dseegers
Copy link
Member

dseegers commented Jul 1, 2021

@maikelRAOW

Maybe it's not something to judge but just wanted to pass it on :).

Inside the ComponentRepo, App(.php), RouteManager all basic exceptions are thrown.

Wouldn't it be nice to extend these from a base exception and specify them out, making them less generic: for example a component exception, route exception, etc. Here you can later choose to do something with these exceptions, otherwise, you will catch everything at once.

@ChrisRAoW
Copy link
Contributor

@dseegers Good suggestion mate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants