Closed roukmoute closed 7 years ago
Well, you could write it like this, for example:
public function speed(): ?float
{
$isSpeedInformation = function (AdditionalInformation $additionalInformation) {
return $additionalInformation->name() === 'Speed';
};
$speedInformation = find($this->additionalEventInfo, $isSpeedInformation);
return $speedInformation ? (float) $speedInformation->value() : null;
}
If you think that's more readable ;)
You're right :clap:
Hi!
I have originaly this part of code:
I've "translated" this code with Knapsack:
Finally, I don't like this code. It is not really more readable that original.
Is it a better solution?
Thanks