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

WIP: GPHWPP-3655 Dashboard - NBA #76

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

DerHerrFeldmann
Copy link

No description provided.

*
* @return string
*/
public function get_title() {
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

@lgersman lgersman Feb 13, 2025

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

Copy link
Contributor

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;
Copy link
Contributor

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.

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

Successfully merging this pull request may close these issues.

3 participants