diff -Nru php-league-mime-type-detection-1.9.0+ds/CHANGELOG.md php-league-mime-type-detection-1.10.0+ds/CHANGELOG.md --- php-league-mime-type-detection-1.9.0+ds/CHANGELOG.md 2021-11-21 11:48:40.000000000 +0000 +++ php-league-mime-type-detection-1.10.0+ds/CHANGELOG.md 2022-04-11 12:49:04.000000000 +0000 @@ -1,12 +1,18 @@ # Changelog +## 1.10.0 - 2022-04-11 + +### Fixed + +- Added Flysystem v1 inconclusive mime-types and made it configurable as a constructor parameter. + ## 1.9.0 - 2021-11-21 ### Updated - Updated lookup -- ## 1.8.0 - 2021-09-25 +## 1.8.0 - 2021-09-25 ### Added diff -Nru php-league-mime-type-detection-1.9.0+ds/debian/changelog php-league-mime-type-detection-1.10.0+ds/debian/changelog --- php-league-mime-type-detection-1.9.0+ds/debian/changelog 2021-11-26 23:33:25.000000000 +0000 +++ php-league-mime-type-detection-1.10.0+ds/debian/changelog 2022-04-14 09:46:47.000000000 +0000 @@ -1,3 +1,10 @@ +php-league-mime-type-detection (1.10.0+ds-1) unstable; urgency=medium + + * New upstream version 1.10.0+ds + * Remove obsolete patch + + -- Robin Gustafsson Thu, 14 Apr 2022 11:46:47 +0200 + php-league-mime-type-detection (1.9.0+ds-1) unstable; urgency=medium * New upstream version 1.9.0+ds diff -Nru php-league-mime-type-detection-1.9.0+ds/debian/patches/0003-Inherit-PHPUnit-s-TestCase-instead-of-PHPStan-s.patch php-league-mime-type-detection-1.10.0+ds/debian/patches/0003-Inherit-PHPUnit-s-TestCase-instead-of-PHPStan-s.patch --- php-league-mime-type-detection-1.9.0+ds/debian/patches/0003-Inherit-PHPUnit-s-TestCase-instead-of-PHPStan-s.patch 2021-11-26 23:27:22.000000000 +0000 +++ php-league-mime-type-detection-1.10.0+ds/debian/patches/0003-Inherit-PHPUnit-s-TestCase-instead-of-PHPStan-s.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From: Robin Gustafsson -Date: Sat, 27 Nov 2021 00:14:21 +0100 -Subject: Inherit PHPUnit's TestCase instead of PHPStan's - -One of the test classes inherits PHPStan's UnitTest class instead of -the usual PHPUnit TestCase. It seems to give identical behavior in this -test, and sticking to the typical PHPUnit class is more consistent. - -Forwarded: https://github.com/thephpleague/mime-type-detection/pull/15 ---- - src/OverridingExtensionToMimeTypeMapTest.php | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/OverridingExtensionToMimeTypeMapTest.php b/src/OverridingExtensionToMimeTypeMapTest.php -index b156524..4725855 100644 ---- a/src/OverridingExtensionToMimeTypeMapTest.php -+++ b/src/OverridingExtensionToMimeTypeMapTest.php -@@ -2,7 +2,7 @@ - - namespace League\MimeTypeDetection; - --use PHPStan\Testing\TestCase; -+use PHPUnit\Framework\TestCase; - - class OverridingExtensionToMimeTypeMapTest extends TestCase - { diff -Nru php-league-mime-type-detection-1.9.0+ds/debian/patches/series php-league-mime-type-detection-1.10.0+ds/debian/patches/series --- php-league-mime-type-detection-1.9.0+ds/debian/patches/series 2021-11-26 23:27:22.000000000 +0000 +++ php-league-mime-type-detection-1.10.0+ds/debian/patches/series 2022-04-14 09:46:47.000000000 +0000 @@ -1,3 +1,2 @@ 0001-Use-local-mime-db-instead-of-downloading-one.patch 0002-Skip-generated-map-should-be-up-to-date-test.patch -0003-Inherit-PHPUnit-s-TestCase-instead-of-PHPStan-s.patch diff -Nru php-league-mime-type-detection-1.9.0+ds/LICENSE php-league-mime-type-detection-1.10.0+ds/LICENSE --- php-league-mime-type-detection-1.9.0+ds/LICENSE 2021-11-21 11:48:40.000000000 +0000 +++ php-league-mime-type-detection-1.10.0+ds/LICENSE 2022-04-11 12:49:04.000000000 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2013-2020 Frank de Jonge +Copyright (c) 2013-2022 Frank de Jonge Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -Nru php-league-mime-type-detection-1.9.0+ds/src/FinfoMimeTypeDetector.php php-league-mime-type-detection-1.10.0+ds/src/FinfoMimeTypeDetector.php --- php-league-mime-type-detection-1.9.0+ds/src/FinfoMimeTypeDetector.php 2021-11-21 11:48:40.000000000 +0000 +++ php-league-mime-type-detection-1.10.0+ds/src/FinfoMimeTypeDetector.php 2022-04-11 12:49:04.000000000 +0000 @@ -11,7 +11,13 @@ class FinfoMimeTypeDetector implements MimeTypeDetector { - private const INCONCLUSIVE_MIME_TYPES = ['application/x-empty', 'text/plain', 'text/x-asm']; + private const INCONCLUSIVE_MIME_TYPES = [ + 'application/x-empty', + 'text/plain', + 'text/x-asm', + 'application/octet-stream', + 'inode/x-empty', + ]; /** * @var finfo @@ -28,14 +34,21 @@ */ private $bufferSampleSize; + /** + * @var array + */ + private $inconclusiveMimetypes; + public function __construct( string $magicFile = '', ExtensionToMimeTypeMap $extensionMap = null, - ?int $bufferSampleSize = null + ?int $bufferSampleSize = null, + array $inconclusiveMimetypes = self::INCONCLUSIVE_MIME_TYPES ) { $this->finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap(); $this->bufferSampleSize = $bufferSampleSize; + $this->inconclusiveMimetypes = $inconclusiveMimetypes; } public function detectMimeType(string $path, $contents): ?string @@ -44,7 +57,7 @@ ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null) : null; - if ($mimeType !== null && ! in_array($mimeType, self::INCONCLUSIVE_MIME_TYPES)) { + if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) { return $mimeType; } diff -Nru php-league-mime-type-detection-1.9.0+ds/src/OverridingExtensionToMimeTypeMapTest.php php-league-mime-type-detection-1.10.0+ds/src/OverridingExtensionToMimeTypeMapTest.php --- php-league-mime-type-detection-1.9.0+ds/src/OverridingExtensionToMimeTypeMapTest.php 2021-11-21 11:48:40.000000000 +0000 +++ php-league-mime-type-detection-1.10.0+ds/src/OverridingExtensionToMimeTypeMapTest.php 2022-04-11 12:49:04.000000000 +0000 @@ -2,7 +2,7 @@ namespace League\MimeTypeDetection; -use PHPStan\Testing\TestCase; +use PHPUnit\Framework\TestCase; class OverridingExtensionToMimeTypeMapTest extends TestCase {