Closed stollr closed 1 year ago
There's not a ternary operator here, and this is a bit of a stylistic issue that I'd rather not edit away. Some people like single points of return (I'm not one of those). I don't see a substantial improvement here, so I'm declining this.
You are right. The title of the PR is misleading. The changed code is the equivalent of the ternary operator. In the example for the usage of the ternary operator, there is a single point of return. So I thought the equivalent should follow that.
But nevermind.
The code example for standard if-else was not really equivalent to the example where the ternary operator was used. The additional
$salary
variable is not needed.If you like this PR I'd be happy if you would merge it or label it with
hacktoberfest-accepted
. Thanks in advance.