Skip to content

Commit bd91f9b

Browse files
authored
Merge pull request #8 from Micro-PHP/v1.6.0-dev
v1.6.0 release
2 parents 5b5712a + 7b33c41 commit bd91f9b

File tree

2 files changed

+40
-49
lines changed

2 files changed

+40
-49
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111
],
1212
"require": {
13-
"micro/plugin-http-core": "^1",
14-
"micro/plugin-logger-core": "^1"
13+
"micro/plugin-http-core": "^1.6",
14+
"micro/plugin-logger-core": "^1.6"
1515
},
1616
"require-dev": {
1717
"ergebnis/composer-normalize": "^2.29",

src/Business/Logger/Formatter/Format/RequestBodyFormat.php

Lines changed: 38 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -25,53 +25,44 @@ protected function getVarValue(Request $request, Response|null $response, ?\Thro
2525
{
2626
$type = (string) $request->headers->get('Content-Type');
2727

28-
switch ($type) {
29-
case 'application/EDI-X12':
30-
case 'application/javascript':
31-
case 'application/EDIFACT':
32-
case 'application/xhtml+xml':
33-
return sprintf('~%s Content~', $this->getTypeFrontName($type));
34-
case 'application/zip':
35-
return '~ZIP Binary~';
36-
case 'application/x-shockwave-flash':
37-
return '~FLASH Binary~';
38-
case 'application/pdf':
39-
return '~PDF Binary~';
40-
case 'application/ogg':
41-
return 'OGG Binary';
42-
case 'audio/mpeg':
43-
case 'audio/x-ms-wma':
44-
case 'audio/vnd.rn-realaudio':
45-
case 'audio/x-wav':
46-
return sprintf('~Audio %s content~', $this->getTypeFrontName($type));
47-
case 'application/vnd.oasis.opendocument.text':
48-
case 'application/vnd.oasis.opendocument.spreadsheet':
49-
case 'application/vnd.oasis.opendocument.presentation':
50-
case 'application/vnd.oasis.opendocument.graphics':
51-
case 'application/vnd.ms-excel':
52-
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
53-
case 'application/vnd.ms-powerpoint':
54-
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
55-
case 'application/msword':
56-
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
57-
case 'application/vnd.mozilla.xul+xml':
58-
return sprintf('~VND %s~', $this->getTypeFrontName($type));
59-
case 'video/mpeg':
60-
case 'video/mp4':
61-
case 'video/quicktime':
62-
case 'video/x-ms-wmv':
63-
case 'video/x-msvideo':
64-
case 'video/x-flv':
65-
case 'video/webm':
66-
return sprintf('~Video %s~', $this->getTypeFrontName($type));
67-
case 'multipart/form-data':
68-
case 'multipart/mixed':
69-
case 'multipart/alternative':
70-
case 'multipart/related':
71-
return sprintf('~Multipart %s~', $this->getTypeFrontName($type));
72-
default:
73-
return $request->getContent();
74-
}
28+
return match ($type) {
29+
'application/EDI-X12', 'application/javascript', 'application/EDIFACT', 'application/xhtml+xml' => sprintf('~%s Content~', $this->getTypeFrontName($type)),
30+
'application/zip' => '~ZIP Binary~',
31+
'application/x-shockwave-flash' => '~FLASH Binary~',
32+
'application/pdf' => '~PDF Binary~',
33+
'application/ogg' => 'OGG Binary',
34+
'audio/mpeg',
35+
'audio/x-ms-wma',
36+
'audio/vnd.rn-realaudio',
37+
'audio/x-wav' => sprintf('~Audio %s content~', $this->getTypeFrontName($type)),
38+
39+
'application/vnd.oasis.opendocument.text',
40+
'application/vnd.oasis.opendocument.spreadsheet',
41+
'application/vnd.oasis.opendocument.presentation',
42+
'application/vnd.oasis.opendocument.graphics',
43+
'application/vnd.ms-excel',
44+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
45+
'application/vnd.ms-powerpoint',
46+
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
47+
'application/msword',
48+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
49+
'application/vnd.mozilla.xul+xml' => sprintf('~VND %s~', $this->getTypeFrontName($type)),
50+
51+
'video/mpeg',
52+
'video/mp4',
53+
'video/quicktime',
54+
'video/x-ms-wmv',
55+
'video/x-msvideo',
56+
'video/x-flv',
57+
'video/webm' => sprintf('~Video %s~', $this->getTypeFrontName($type)),
58+
59+
'multipart/form-data',
60+
'multipart/mixed',
61+
'multipart/alternative',
62+
'multipart/related' => sprintf('~Multipart %s~', $this->getTypeFrontName($type)),
63+
64+
default => $request->getContent(),
65+
};
7566
}
7667

7768
protected function getVarName(): string

0 commit comments

Comments
 (0)