-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP: GPHWPP-3655 Dashboard - NBA #76
base: develop
Are you sure you want to change the base?
Conversation
* | ||
* @return string | ||
*/ | ||
public function get_title() { |
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.
Das könnte man auch mit Magic Gettern machen: https://www.php.net/manual/en/language.oop5.overloading.php#object.get Damit spart man sich alle Getter
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.
Even shorter using readonly classes / properties https://stitcher.io/blog/readonly-classes-in-php-82
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.
And please move the types from phpdoc comments to php - it's 2025 - we use PHP 8.3 🤓
BTW: From my opinion most multiline comments can be removed from the class properties if the types are declared in native PHP (=> no one needs the information that the description property contains the description, isn't it ?)
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.
Just an idea - why not locating the model in packages/wp-plugin/essentials/src/dashboard/blocks/next-best-actions/model.php
?
As long as the model only consists of one file, the directory around it is superfluous - think of KISS (https://en.wikipedia.org/wiki/KISS_principle). And i suspect there won't be many more models.
* This class represents the Next Best Action (NBA) model. | ||
*/ | ||
|
||
namespace ionos_wordpress\essentials\dashboard\blocks\next_best_actions\model; |
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.
why creating a namespace for just one class in just one file ?
As long as the model only consists of one file, the extra namespace around it is superfluous - think of KISS (https://en.wikipedia.org/wiki/KISS_principle). And i suspect there won't be many more models.
No description provided.