-
Notifications
You must be signed in to change notification settings - Fork 11k
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
HasAttributes::hasChanges null attributes parameter detection #23924
Comments
I'll fix it. |
What is there to fix here? Calling What's your use case for calling |
Since the default value of the
|
If anything, that's an argument for changing the default to |
The result of |
Description:
The
hasChanges()
method checks for empty $attributes at entrance.However, functions like
isDirty()
andwasChanged()
calls the method like these:When called through
isDirty()
like$this->isDirty(null);
,hasChanges()
receives the$attributes
parameter as an array of[null]
due tois_array($attributes) ? $attributes : func_get_args()
. Which in turn skips right through the empty check and returns a faulty false.Steps To Reproduce:
Just call
$this->isDirty(null);
on any modified model instance.The text was updated successfully, but these errors were encountered: