Skip to content

Commit 1999470

Browse files
author
Karel Wintersky
committed
1.99.0
* [R] PHP 8.0 compatible
1 parent 57d7c42 commit 1999470

File tree

4 files changed

+14
-28
lines changed

4 files changed

+14
-28
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=7.2"
15+
"php": ">=7.2 || ^8.0"
1616
},
1717
"require-dev": {
18-
"phpunit/phpunit": "^4.8 || ^5.7 || ^6.5",
18+
"phpunit/phpunit": "9.*",
1919
"php-coveralls/php-coveralls": "^1.1"
2020
},
2121
"autoload": {

phpunit.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/MimeTypes.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class MimeTypes implements MimeTypesInterface
1717
* Generated from source on 8 Aug 2023, 10:48pm MSK
1818
*/
1919
protected static $mime_types = [
20+
2021
'mimes' => [
2122
'3dml' => 'text/vnd.in3d.3dml',
2223
'3ds' => 'image/x-3ds',
@@ -1044,6 +1045,7 @@ class MimeTypes implements MimeTypesInterface
10441045
'zmm' => 'application/vnd.handheld-entertainment+xml',
10451046
123 => 'application/vnd.lotus-1-2-3',
10461047
],
1048+
10471049
'extensions' => [
10481050
'application/andrew-inset' => 'ez',
10491051
'application/applixware' => 'aw',
@@ -1855,14 +1857,14 @@ public static function getAllExtensions():array
18551857

18561858
public static function getExtension(string $mime_type):string
18571859
{
1858-
return array_key_exists($mime_type, self::$mime_types['extensions']) ? self::$mime_types['extensions'][$mime_type] : '';
1860+
return \array_key_exists($mime_type, self::$mime_types['extensions']) ? self::$mime_types['extensions'][$mime_type] : '';
18591861
}
18601862

18611863
public static function fromExtension(string $extension):string
18621864
{
18631865
$extension = self::normalize($extension);
18641866

1865-
return array_key_exists($extension, self::$mime_types['mimes']) ? self::$mime_types['mimes'][$extension] : '';
1867+
return \array_key_exists($extension, self::$mime_types['mimes']) ? self::$mime_types['mimes'][$extension] : '';
18661868
}
18671869

18681870
public static function fromFilename(string $filename):string
@@ -1878,9 +1880,9 @@ public static function fromFilename(string $filename):string
18781880
*/
18791881
private static function normalize(string $input):string
18801882
{
1881-
return trim(
1882-
strtolower(
1883-
trim($input)),
1883+
return \trim(
1884+
\strtolower(
1885+
\trim($input)),
18841886
'.'
18851887
);
18861888
}

tools/template.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class MimeTypes implements MimeTypesInterface
3131

3232
public static function getExtension(string $mime_type):string
3333
{
34-
return array_key_exists($mime_type, self::$mime_types['extensions']) ? self::$mime_types['extensions'][$mime_type] : '';
34+
return \array_key_exists($mime_type, self::$mime_types['extensions']) ? self::$mime_types['extensions'][$mime_type] : '';
3535
}
3636

3737
public static function fromExtension(string $extension):string
3838
{
3939
$extension = self::normalize($extension);
4040

41-
return array_key_exists($extension, self::$mime_types['mimes']) ? self::$mime_types['mimes'][$extension] : '';
41+
return \array_key_exists($extension, self::$mime_types['mimes']) ? self::$mime_types['mimes'][$extension] : '';
4242
}
4343

4444
public static function fromFilename(string $filename):string
@@ -54,9 +54,9 @@ class MimeTypes implements MimeTypesInterface
5454
*/
5555
private static function normalize(string $input):string
5656
{
57-
return trim(
58-
strtolower(
59-
trim($input)),
57+
return \trim(
58+
\strtolower(
59+
\trim($input)),
6060
'.'
6161
);
6262
}

0 commit comments

Comments
 (0)