I understand that you wanted to optimize the code here, but it ends up with a very long line of code, wich phpcs will not appreciate. Also, it's a bit harder to read, but as I said, I understand that you don't want to write a full `if` clause.