| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public static function fromGlobals( |
||
| 27 | array $server = null, |
||
| 28 | array $query = null, |
||
| 29 | array $body = null, |
||
| 30 | array $cookies = null, |
||
| 31 | array $files = null |
||
| 32 | ) : ServerRequest { |
||
| 33 | $server = parent::normalizeServer($server); |
||
| 34 | $files = parent::normalizeFiles($files); |
||
| 35 | $headers = parent::marshalHeaders($server); |
||
| 36 | return new ServerRequest( |
||
| 37 | $server, |
||
| 38 | $files, |
||
| 39 | parent::marshalUriFromServer($server, $headers), |
||
| 40 | parent::get('REQUEST_METHOD', $server, 'GET'), |
||
| 41 | 'php://input', |
||
| 42 | $headers, |
||
| 43 | $cookies, |
||
| 44 | $query, |
||
| 45 | $body, |
||
| 46 | self::marshalProtocolVersion($server) |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |
Overwriting private methods is generally fine as long as you also use private visibility. It might still be preferable for understandability to use a different method name.