Accessing request on the interface Psr\Container\ContainerInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
34
35
3
if ($ipAdr) {
36
3
if (filter_var($ipAdr, FILTER_VALIDATE_IP)) {
37
2
$valid = "True";
38
2
$host = gethostbyaddr($ipAdr);
39
} else {
40
1
$valid = "False";
41
}
42
43
3
if ($valid === "True") {
44
2
if (filter_var($ipAdr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {