-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Mini DOCBlock update #4415
base: main
Are you sure you want to change the base?
Mini DOCBlock update #4415
Conversation
1aedd15
to
8bbdfff
Compare
8bbdfff
to
c9a1db8
Compare
c9a1db8
to
8252c97
Compare
Fixes some issues found during work on magerun v3 release. |
Ignore CS, fixed in #4425 |
* @method bool getIsActive() | ||
* @method $this setIsActive(bool $value) | ||
* @method bool getIsAnchor() | ||
* @method $this setIsAnchor(bool $value) | ||
* @method int getIsActive() | ||
* @method $this setIsActive(int $value) | ||
* @method int getIsAnchor() | ||
* @method $this setIsAnchor(int $value) |
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.
Are there going to be negative consequences of putting the return type we wish we had instead of the one we actually have? The return type is actually likely to be string "0|1" because of the horrible decision of someone long ago to make PDO return strings for all data types. But it could also be bool or int because of inconsistencies in the use of the setter. That is:
$category = Mage::getModel('catalog/category')->load(1);
var_dump($category->getIsActive()); // string "0|1"
$category->setIsActive(true);
var_dump($category->getIsActive()); // bool true
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.
No. In the past, when i added method annotions i took the values i have found. E.g. bool, but in PDO its either string or int. bool is wrong for DB values .
magerun uses (int) constants for active/inactive, thats looks more correct to me.
Id like to continue #4376 and add getter/setter methods to reflect the correct type ... later.
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.
Sure, just something to be thinking about. :)
No description provided.