You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parameter identical of the method isAttributeChanged in class BaseActiveRecord has no effect when its value is false.
/** * Returns a value indicating whether the named attribute has been changed. * * @param string $name The name of the attribute. * @param bool $identical Whether the comparison of new and old value is made for identical values using `===`, * defaults to `true`. Otherwise `==` is used for comparison. * * @return bool Whether the attribute has been changed. */publicfunctionisAttributeChanged(string$name, bool$identical = true): bool
{
if (isset($this->attributes[$name], $this->oldAttributes[$name])) {
if ($identical) {
return$this->attributes[$name] !== $this->oldAttributes[$name];
}
return$this->attributes[$name] !== $this->oldAttributes[$name]; // !== in this line of code should be replaced with !=
}
returnisset($this->attributes[$name]) || isset($this->oldAttributes[$name]);
}
What is the expected result?
The method implementation is consistent with the description, use == for comparison when the parameter identical is false
What do you get instead?
Method implementation is inconsistent with description
Additional info
Q
A
Version
1.0.?
PHP version
8.2
Operating system
MacOS
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
The parameter identical of the method isAttributeChanged in class BaseActiveRecord has no effect when its value is false.
What is the expected result?
The method implementation is consistent with the description, use == for comparison when the parameter identical is false
What do you get instead?
Method implementation is inconsistent with description
Additional info
The text was updated successfully, but these errors were encountered: