Ad
  • Default User Avatar

    Thanks for your feedback, I myself am still not overly happy with this construct.
    Normally, I got used to defining small "speaking" functions with guards and pattern matching in function heads :)

    As I gave up on PHP in favor of Elixir for some years now, but was "raised" by my former co-workers for like 10 years with a "don't ever use ternaries (for they can make code even more obscure)" policy, I think, the best way (regarding readability) would be, to use a small additional function for this, if one wants to avoid ternary operators.