diff --git a/CHANGELOG.md b/CHANGELOG.md index 8321e45..d44e6a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [2.1.0] - 2024-04-29 + +Tagging as non-patch release due to a change in the interfaces namespace. See [UPGRADING](UPGRADING.md). ### Added @@ -25,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Updated dev dependencies. * `Generator::generatePhpEnum()` can now throw a `RuntimeException` if `generateMapping` returns an empty array. * Refactored `Generator::generateMapping()` make use of a helper function to reduce function complexity. + * Renamed `Esi\Mimey\Interface` namespace to `Esi\Mimey\Interfaces` ### Fixed @@ -120,6 +123,7 @@ Initial fork from [elephox-dev/mimey](https://github.com/elephox-dev/mimey) * So essentially, this is not a new feature/update release. More of just bringing it inline with my preferences. [unreleased]: https://github.com/ericsizemore/mimey/tree/develop +[2.1.0]: https://github.com/ericsizemore/mimey/releases/tag/v2.1.0 [2.0.0]: https://github.com/ericsizemore/mimey/releases/tag/v2.0.0 [1.2.0]: https://github.com/ericsizemore/mimey/releases/tag/v1.2.0 [1.1.1]: https://github.com/ericsizemore/mimey/releases/tag/v1.1.1 diff --git a/UPGRADING.md b/UPGRADING.md index beddb0a..70245c7 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,5 +1,13 @@ # UPGRADING +## 2.0.0 to 2.1.0 + +Unfortunately, when deciding to use the `Esi\Mimey\Interface` namespace to hold all library interfaces, while it has not caused any issues, `Interface` is technically a reserved keyword. To potentially prevent any issues, 2.1.0 changes this to `Esi\Mimey\Interfaces`. + +This should have no affect on most users. If you are using any of the interfaces directly, just update the call to that interface. For example: + + * `Esi\Mimey\Interface\MimeTypeInterface` -> `Esi\Mimey\Interfaces\MimeTypeInterface` + ## 1.x to 2.x * `dist/MimeType.php` remains the same. diff --git a/composer.json b/composer.json index e679efc..7ef3a79 100644 --- a/composer.json +++ b/composer.json @@ -97,9 +97,9 @@ "cs:fix": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php", "cs:check": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff", "phpstan": "vendor/bin/phpstan analyse -c phpstan.neon", - "psalm": "vendor/bin/psalm --no-diff --use-baseline=psalm-baseline.xml", - "psalm:ci": "vendor/bin/psalm --no-diff --long-progress --output-format=github --use-baseline=psalm-baseline.xml", - "psalm:stats": "vendor/bin/psalm --no-diff --stats --use-baseline=psalm-baseline.xml", + "psalm": "vendor/bin/psalm --no-diff", + "psalm:ci": "vendor/bin/psalm --no-diff --long-progress --output-format=github", + "psalm:stats": "vendor/bin/psalm --no-diff --stats", "test": "phpunit", "update-types": "@php bin/update.php" } diff --git a/dist/MimeType.php b/dist/MimeType.php index f127d23..2d9095a 100644 --- a/dist/MimeType.php +++ b/dist/MimeType.php @@ -10,7 +10,7 @@ namespace Esi\Mimey; use InvalidArgumentException; -use Esi\Mimey\Interface\MimeTypeInterface; +use Esi\Mimey\Interfaces\MimeTypeInterface; enum MimeType: string implements MimeTypeInterface { diff --git a/src/Interface/BuilderInterface.php b/src/Interfaces/BuilderInterface.php similarity index 98% rename from src/Interface/BuilderInterface.php rename to src/Interfaces/BuilderInterface.php index 76fb32f..6425b45 100644 --- a/src/Interface/BuilderInterface.php +++ b/src/Interfaces/BuilderInterface.php @@ -20,7 +20,7 @@ * Copyright (c) 2016 Ralph Khattar */ -namespace Esi\Mimey\Interface; +namespace Esi\Mimey\Interfaces; use JsonException; use RuntimeException; diff --git a/src/Interface/MimeTypeInterface.php b/src/Interfaces/MimeTypeInterface.php similarity index 96% rename from src/Interface/MimeTypeInterface.php rename to src/Interfaces/MimeTypeInterface.php index df2fbcd..7fe5953 100644 --- a/src/Interface/MimeTypeInterface.php +++ b/src/Interfaces/MimeTypeInterface.php @@ -20,7 +20,7 @@ * Copyright (c) 2016 Ralph Khattar */ -namespace Esi\Mimey\Interface; +namespace Esi\Mimey\Interfaces; /** * MimeType Enum Interface. diff --git a/src/Interface/MimeTypesInterface.php b/src/Interfaces/MimeTypesInterface.php similarity index 98% rename from src/Interface/MimeTypesInterface.php rename to src/Interfaces/MimeTypesInterface.php index a2ed74d..4f63aeb 100644 --- a/src/Interface/MimeTypesInterface.php +++ b/src/Interfaces/MimeTypesInterface.php @@ -20,7 +20,7 @@ * Copyright (c) 2016 Ralph Khattar */ -namespace Esi\Mimey\Interface; +namespace Esi\Mimey\Interfaces; /** * An interface for converting between MIME types and file extensions. diff --git a/src/Mapping/Builder.php b/src/Mapping/Builder.php index 0b4705a..f5374b5 100644 --- a/src/Mapping/Builder.php +++ b/src/Mapping/Builder.php @@ -22,7 +22,7 @@ namespace Esi\Mimey\Mapping; -use Esi\Mimey\Interface\BuilderInterface; +use Esi\Mimey\Interfaces\BuilderInterface; use RuntimeException; use Throwable; diff --git a/src/Mapping/Generator.php b/src/Mapping/Generator.php index 92b1329..1992b2c 100644 --- a/src/Mapping/Generator.php +++ b/src/Mapping/Generator.php @@ -22,7 +22,7 @@ namespace Esi\Mimey\Mapping; -use Esi\Mimey\Interface\MimeTypeInterface; +use Esi\Mimey\Interfaces\MimeTypeInterface; use JsonException; use RuntimeException; diff --git a/src/MimeTypes.php b/src/MimeTypes.php index 447f586..00b2a85 100644 --- a/src/MimeTypes.php +++ b/src/MimeTypes.php @@ -22,7 +22,7 @@ namespace Esi\Mimey; -use Esi\Mimey\Interface\MimeTypesInterface; +use Esi\Mimey\Interfaces\MimeTypesInterface; use RuntimeException; use Throwable; diff --git a/tests/src/GeneratorTest.php b/tests/src/GeneratorTest.php index 245aeb0..43f381f 100644 --- a/tests/src/GeneratorTest.php +++ b/tests/src/GeneratorTest.php @@ -150,7 +150,7 @@ public function testGeneratePhpEnum(): void namespace TestMimeNamespace; use InvalidArgumentException; - use Esi\Mimey\Interface\MimeTypeInterface; + use Esi\Mimey\Interfaces\MimeTypeInterface; enum TestMimeClass: string implements MimeTypeInterface { @@ -229,7 +229,7 @@ public function testGeneratePhpEnumDefault(): void namespace Esi\Mimey; use InvalidArgumentException; - use Esi\Mimey\Interface\MimeTypeInterface; + use Esi\Mimey\Interfaces\MimeTypeInterface; enum MimeType: string implements MimeTypeInterface {