1 | <?php |
||
7 | class ServerParams extends Parameter implements ServerParamsInterface |
||
8 | { |
||
9 | /** |
||
10 | * @reference https://www.sitepoint.com/web-foundations/mime-types-complete-list/ |
||
11 | * @reference https://msdn.microsoft.com/ko-kr/library/microsoft.reportingservices.reportrendering.image.mimetype%28v=sql.120%29.aspx (for IE) |
||
12 | * @reference http://sunwebexpert.com/books/detail/php/ie-non-standard-image-mime-type.html (for IE) |
||
13 | * @var array |
||
14 | */ |
||
15 | protected static $mimeTypes = [ |
||
16 | 'html' => ['text/html', 'application/xhtml+xml'], |
||
17 | 'txt' => ['text/plain'], |
||
18 | 'js' => ['application/x-javascript', 'application/javascript', 'application/ecmascript', 'text/javascript', 'text/ecmascript'], |
||
19 | 'css' => ['application/x-pointplus', 'text/css'], |
||
20 | 'json' => ['application/json', 'application/x-json'], |
||
21 | 'xml' => ['text/xml', 'application/xml', 'application/x-xml'], |
||
22 | 'atom' => ['application/atom+xml'], |
||
23 | 'rss' => ['application/rss+xml'], |
||
24 | 'form' => ['application/x-www-form-urlencoded'], |
||
25 | ]; |
||
26 | |||
27 | /** @var \Psr\Http\Message\ServerRequestInterface */ |
||
28 | protected $request; |
||
29 | |||
30 | /** |
||
31 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
32 | */ |
||
33 | 5 | public function __construct(ServerRequestInterface $request) |
|
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | 1 | public function isAjax() |
|
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | 1 | public function getIpAddress($customHeaderName = null) |
|
55 | |||
56 | /** |
||
57 | * @reference https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html |
||
58 | * @reference https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 1 | public function accepts($contentTypes) |
|
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function getLanguages() |
||
91 | |||
92 | /** |
||
93 | * @param string $type |
||
94 | * @return array |
||
95 | */ |
||
96 | 1 | private function splitType($type) |
|
102 | } |
||
103 |
This checks looks for assignemnts to variables using the
list(...)
function, where not all assigned variables are subsequently used.Consider the following code example.
Only the variables
$a
and$c
are used. There was no need to assign$b
.Instead, the list call could have been.