`strtolower` was called three times at most on the same value, and one
at least. To avoid this, let's compute it first.
Additionally, $value cast in last return clause was useless as it has
been done previously, and nothing changed $value's value.
Signed-off-by: Romain Dorgueil <romain.dorgueil@symfony-project.com>