This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
ServerRequestFactory::fromGlobals()
checks if args are truthy rather than set
#281
Labels
In
ServerRequestFactory::fromGlobals()
, most of the code checks if the arguments are truthy, rather than set. For example:zend-diactoros/src/ServerRequestFactory.php
Lines 57 to 58 in 89d471c
zend-diactoros/src/ServerRequestFactory.php
Lines 72 to 74 in 89d471c
This becomes an issue during testing (or a long-running process that accepts multiple requests). For example:
Improved versions would be:
Or for under PHP 7:
(This code should fix the issues, but I didn't have time to write any tests right now, so I'm opening an issue instead of a pr.)
The text was updated successfully, but these errors were encountered: