Skip to content
This repository has been archived by the owner. 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

commented May 31, 2019

fixes #393
fixes #543
fixes #573

@Gummibeer Gummibeer requested a review from dimsav May 31, 2019

@Gummibeer Gummibeer self-assigned this May 31, 2019

Gummibeer added some commits May 31, 2019

@Gummibeer

This comment has been minimized.

Copy link
Collaborator Author

commented May 31, 2019

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

Gummibeer added some commits May 31, 2019

@dimsav

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Collaborator Author

commented May 31, 2019

@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

This comment has been minimized.

Copy link
Owner

commented May 31, 2019

Love it. Good to go. 👌

@Gummibeer Gummibeer merged commit bf40613 into master Jun 3, 2019

6 checks passed

ci/circleci: build-php72-laravel56 Your tests passed on CircleCI!
Details
ci/circleci: build-php72-laravel57 Your tests passed on CircleCI!
Details
ci/circleci: build-php72-laravel58 Your tests passed on CircleCI!
Details
ci/circleci: build-php73-laravel58 Your tests passed on CircleCI!
Details
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/styleci/push The analysis has passed
Details

@Gummibeer Gummibeer deleted the fix-non-string-translation-values-fallback branch Jun 3, 2019

@Gummibeer

This comment has been minimized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.