Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

add isEmptyTranslatableAttribute() to allow custom decision logic #576

Merged
merged 16 commits into from
Jun 3, 2019

Conversation

Gummibeer
Copy link
Collaborator

@Gummibeer Gummibeer commented May 31, 2019

fixes #393
fixes #543
fixes #573

@Gummibeer Gummibeer requested a review from dimsav May 31, 2019 10:27
@Gummibeer Gummibeer self-assigned this May 31, 2019
@Gummibeer
Copy link
Collaborator Author

and this is how it looks if you don't want to run local CircleCI cli. 🙈 😂

@dimsav
Copy link
Owner

dimsav commented May 31, 2019

@Gummibeer I'm trying to understand why this change fixes the bug. Can you please explain?

Also, the first argument ($key) is never used. Why do we need it in isEmptyTranslatableAttribute()?

@Gummibeer
Copy link
Collaborator Author

@dimsav I see no way to cover all possible cases in this package with a single comparison - all will fail in some circumstances.
Putting the check in a special method which provides $key and $value allows the user to put in his custom logic which can also differ by attribute name and can also combine multiple checks like is_null($value) || $value === ''.
So this is primary the solution to give the user the tools and ability to adjust the logic.

@dimsav
Copy link
Owner

dimsav commented May 31, 2019

Love it. Good to go. 👌

@Gummibeer Gummibeer merged commit bf40613 into master Jun 3, 2019
@Gummibeer Gummibeer deleted the fix-non-string-translation-values-fallback branch June 3, 2019 06:52
@Gummibeer
Copy link
Collaborator Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants