From a68d91751fbbefcbef505543d8c5584f23fead68 Mon Sep 17 00:00:00 2001 From: Laminas Bot Date: Mon, 4 Apr 2022 20:20:49 +0000 Subject: [PATCH 01/11] Bumps changelog version to 3.11.1 Updates the CHANGELOG.md file to add a changelog entry for a new 3.11.1 version. --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82579a49..87268b3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.11.1 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.11.0 - 2022-04-04 From 7f278c986b97682ceced4cf8087396f9db54a8ab Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 4 Apr 2022 16:41:09 -0500 Subject: [PATCH 02/11] fix: composer package validation Evidently, a replace rule automatically marks a package as a conflict, so defining both is redundant and causes Packagist not to list the branch/release. Additionally, this version removes the dependency on container-interop in the require section, since it provides that dependency itself. Signed-off-by: Matthew Weier O'Phinney --- composer.json | 2 -- composer.lock | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index de942a8b..42ca68b0 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,6 @@ }, "require": { "php": "~7.4.0 || ~8.0.0 || ~8.1.0", - "container-interop/container-interop": "^1.2", "laminas/laminas-stdlib": "^3.2.1", "psr/container": "^1.0" }, @@ -54,7 +53,6 @@ "psr/container-implementation": "^1.0" }, "conflict": { - "container-interop/container-interop": "<1.2.0", "laminas/laminas-code": "<3.3.1", "zendframework/zend-code": "<3.3.1", "zendframework/zend-servicemanager": "*" diff --git a/composer.lock b/composer.lock index 146719e1..25c155b1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cbbcc3eeb089bbae147ad532381d5002", + "content-hash": "e238a4c88ecd1972f68bc95830a9f920", "packages": [ { "name": "laminas/laminas-stdlib", @@ -3173,16 +3173,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.3", + "version": "5.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", "shasum": "" }, "require": { @@ -3224,7 +3224,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" }, "funding": [ { @@ -3232,7 +3232,7 @@ "type": "github" } ], - "time": "2020-09-28T05:52:38+00:00" + "time": "2022-04-03T09:37:03+00:00" }, { "name": "sebastian/exporter", @@ -3954,16 +3954,16 @@ }, { "name": "symfony/console", - "version": "v5.4.5", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad" + "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d8111acc99876953f52fe16d4c50eb60940d49ad", - "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad", + "url": "https://api.github.com/repos/symfony/console/zipball/900275254f0a1a2afff1ab0e11abd5587a10e1d6", + "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6", "shasum": "" }, "require": { @@ -4033,7 +4033,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.5" + "source": "https://github.com/symfony/console/tree/v5.4.7" }, "funding": [ { @@ -4049,7 +4049,7 @@ "type": "tidelift" } ], - "time": "2022-02-24T12:45:35+00:00" + "time": "2022-03-31T17:09:19+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4120,16 +4120,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.6", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "d53a45039974952af7f7ebc461ccdd4295e29440" + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d53a45039974952af7f7ebc461ccdd4295e29440", - "reference": "d53a45039974952af7f7ebc461ccdd4295e29440", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3a4442138d80c9f7b600fb297534ac718b61d37f", + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f", "shasum": "" }, "require": { @@ -4164,7 +4164,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.6" + "source": "https://github.com/symfony/filesystem/tree/v5.4.7" }, "funding": [ { @@ -4180,7 +4180,7 @@ "type": "tidelift" } ], - "time": "2022-03-02T12:42:23+00:00" + "time": "2022-04-01T12:33:59+00:00" }, { "name": "symfony/finder", @@ -4808,16 +4808,16 @@ }, { "name": "symfony/process", - "version": "v5.4.5", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "95440409896f90a5f85db07a32b517ecec17fa4c" + "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/95440409896f90a5f85db07a32b517ecec17fa4c", - "reference": "95440409896f90a5f85db07a32b517ecec17fa4c", + "url": "https://api.github.com/repos/symfony/process/zipball/38a44b2517b470a436e1c944bf9b9ba3961137fb", + "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb", "shasum": "" }, "require": { @@ -4850,7 +4850,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.5" + "source": "https://github.com/symfony/process/tree/v5.4.7" }, "funding": [ { @@ -4866,7 +4866,7 @@ "type": "tidelift" } ], - "time": "2022-01-30T18:16:22+00:00" + "time": "2022-03-18T16:18:52+00:00" }, { "name": "symfony/service-contracts", From 86b950f517814a2e6f19a6290e7d97aab18c886f Mon Sep 17 00:00:00 2001 From: Laminas Bot Date: Mon, 4 Apr 2022 21:47:49 +0000 Subject: [PATCH 03/11] 3.11.1 readiness Updates the CHANGELOG.md to set the release date. --- CHANGELOG.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87268b3e..2b5249d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,27 +2,26 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 3.11.1 - TBD +## 3.11.1 - 2022-04-04 -### Added - -- Nothing. - -### Changed -- Nothing. +----- -### Deprecated +### Release Notes for [3.11.1](https://github.com/laminas/laminas-servicemanager/milestone/22) -- Nothing. +### Fixed + +This release fixes package validation warnings that prevented the 3.11 series from being listed on Packagist. -### Removed +### 3.11.1 -- Nothing. +- Total issues resolved: **0** +- Total pull requests resolved: **1** +- Total contributors: **1** -### Fixed +#### Bug -- Nothing. + - [122: Fix issues with Composer package validation](https://github.com/laminas/laminas-servicemanager/pull/122) thanks to @weierophinney ## 3.11.0 - 2022-04-04 From f14e60aac5e3e46aae81601b5276278f81e3e10c Mon Sep 17 00:00:00 2001 From: Laminas Bot Date: Mon, 4 Apr 2022 21:47:58 +0000 Subject: [PATCH 04/11] Bumps changelog version to 3.11.2 Updates the CHANGELOG.md file to add a changelog entry for a new 3.11.2 version. --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b5249d5..0757d3b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.11.2 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.11.1 - 2022-04-04 From 10ca14afbc866d3b452c7dbed51fe8a7034029b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:32:23 +0200 Subject: [PATCH 05/11] bugfix: conflict with `ext-psr` since it is not possible to `class_alias` to a non-user interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a PHP extension around which provides all (most?) PSR interfaces without the need of installing them via composer. Since we do not support this extension and since that extension does not make sense anyways (more details later), we explicitly adding a `conflict` to the `composer.json` so that there are no surprises for projects which do have the `psr` extension installed. closes #124 Now to the problem with the extension: There are multiple PSR standards around. Many of them do have multiple major versions around. The extension has to follow semver to avoid breaks in upstream projects. So as of now (v1.2.0), it only provides the interfaces for the v1 versions of the PSR standards. There is no way to provide multiple major versions of the same PSR interface from within one version of the extension. Therefore, at some point, an upstream project is either stuck with the v1 versions of the PSR standards or the extension needs to create a hilarious amount of major versions to reflect all possible combinations of all major versions (cartesian product). Lets just take the PSR-11 + PSR-6 example, we already would have 6 major versions around because PSR-11 has 2 major versions and PSR-6 has 3 major versions: - psr/cache 1.x + psr/container 1.x - psr/cache 1.x + psr/container 2.x - psr/cache 2.x + psr/container 1.x - psr/cache 2.x + psr/container 2.x - psr/cache 3.x + psr/container 1.x - psr/cache 3.x + psr/container 2.x And these are only 2 packages. I lost track on the current progress, but there will be more major versions in the future and thus the amount of major versions for the extension will grow (and with that, the confusion for upstream projects, maintainers, etc.). We highly recommend to use composer to install the PSR standards per package in the version the upstream project can work with. **Do not use the `psr` extension** Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 42ca68b0..e53eecce 100644 --- a/composer.json +++ b/composer.json @@ -53,6 +53,7 @@ "psr/container-implementation": "^1.0" }, "conflict": { + "ext-psr": "*", "laminas/laminas-code": "<3.3.1", "zendframework/zend-code": "<3.3.1", "zendframework/zend-servicemanager": "*" From 40767fabeb304527cd567c8f4c7c444df5cf10a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Thu, 7 Apr 2022 18:52:10 +0200 Subject: [PATCH 06/11] bugfix: update `composer.lock` to contain latest hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- composer.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index 25c155b1..f62e1e43 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e238a4c88ecd1972f68bc95830a9f920", + "content-hash": "aa071135de48212d7c9eba1a27bcbe1c", "packages": [ { "name": "laminas/laminas-stdlib", @@ -5431,5 +5431,5 @@ "platform-overrides": { "php": "7.4.99" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From 8a1f4d53ec93b2e18174f6f186922ef44d11a75a Mon Sep 17 00:00:00 2001 From: Laminas Bot Date: Thu, 7 Apr 2022 17:21:25 +0000 Subject: [PATCH 07/11] 3.11.2 readiness Updates the CHANGELOG.md to set the release date. --- CHANGELOG.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0757d3b1..bb4d6e05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,27 +2,24 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 3.11.2 - TBD +## 3.11.2 - 2022-04-07 -### Added -- Nothing. +----- -### Changed +### Release Notes for [3.11.2](https://github.com/laminas/laminas-servicemanager/milestone/24) -- Nothing. +3.11.x bugfix release (patch) -### Deprecated - -- Nothing. +### 3.11.2 -### Removed - -- Nothing. +- Total issues resolved: **1** +- Total pull requests resolved: **1** +- Total contributors: **2** -### Fixed +#### Bug -- Nothing. + - [125: Conflict with `ext-psr`](https://github.com/laminas/laminas-servicemanager/pull/125) thanks to @boesing and @remicollet ## 3.11.1 - 2022-04-04 From b23bbd81a65ac58e164ff06613e83017b93ef1e0 Mon Sep 17 00:00:00 2001 From: Laminas Bot Date: Thu, 7 Apr 2022 17:21:33 +0000 Subject: [PATCH 08/11] Bumps changelog version to 3.11.3 Updates the CHANGELOG.md file to add a changelog entry for a new 3.11.3 version. --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb4d6e05..a673a0db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.11.3 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.11.2 - 2022-04-07 From 5c9931c07aba7410fed30982749c4a0fc54b17b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20B=C3=A1lint?= Date: Fri, 3 Jun 2022 11:05:51 +0200 Subject: [PATCH 09/11] fix: Build namespace in FactoryCreator with preg_replace to support namespaces which contains class name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ádám Bálint --- src/Tool/FactoryCreator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tool/FactoryCreator.php b/src/Tool/FactoryCreator.php index 2e8325e1..ae8f3984 100644 --- a/src/Tool/FactoryCreator.php +++ b/src/Tool/FactoryCreator.php @@ -16,10 +16,10 @@ use function array_shift; use function count; use function implode; +use function preg_replace; use function sort; use function sprintf; use function str_repeat; -use function str_replace; use function strrpos; use function substr; @@ -65,7 +65,7 @@ public function createFactory($className) return sprintf( self::FACTORY_TEMPLATE, - str_replace('\\' . $class, '', $className), + preg_replace('/\\\\' . $class . '$/', '', $className), $this->createImportStatements($className), $class, $class, From c17d8014fba087e6118650a4e522581235c203a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20B=C3=A1lint?= Date: Fri, 3 Jun 2022 11:08:20 +0200 Subject: [PATCH 10/11] test: Write test for namespace generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ádám Bálint --- test/Tool/FactoryCreatorTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/Tool/FactoryCreatorTest.php b/test/Tool/FactoryCreatorTest.php index fecc3e25..2433d356 100644 --- a/test/Tool/FactoryCreatorTest.php +++ b/test/Tool/FactoryCreatorTest.php @@ -6,11 +6,14 @@ use Laminas\ServiceManager\Tool\FactoryCreator; use LaminasTest\ServiceManager\TestAsset\ComplexDependencyObject; +use LaminasTest\ServiceManager\TestAsset\Foo; use LaminasTest\ServiceManager\TestAsset\InvokableObject; use LaminasTest\ServiceManager\TestAsset\SimpleDependencyObject; use PHPUnit\Framework\TestCase; +use function class_alias; use function file_get_contents; +use function preg_match; class FactoryCreatorTest extends TestCase { @@ -47,4 +50,20 @@ public function testCreateFactoryCreatesForComplexDependencies(): void $this->assertEquals($factory, $this->factoryCreator->createFactory($className)); } + + public function testNamespaceGeneration(): void + { + $testClassNames = [ + 'Foo\\Bar\\Service' => 'Foo\\Bar', + 'Foo\\Service\\Bar\\Service' => 'Foo\\Service\\Bar', + ]; + foreach ($testClassNames as $testFqcn => $expectedNamespace) { + class_alias(Foo::class, $testFqcn); + $generatedFactory = $this->factoryCreator->createFactory($testFqcn); + preg_match('/^namespace\s([^;]+)/m', $generatedFactory, $namespaceMatch); + + $this->assertNotEmpty($namespaceMatch); + $this->assertEquals($expectedNamespace, $namespaceMatch[1]); + } + } } From 03fa589e346ffdb13d90c822698df37d8ccb8041 Mon Sep 17 00:00:00 2001 From: Laminas Bot Date: Mon, 13 Jun 2022 16:13:44 +0000 Subject: [PATCH 11/11] 3.11.3 readiness Updates the CHANGELOG.md to set the release date. --- CHANGELOG.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a673a0db..dc53defa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,27 +2,24 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 3.11.3 - TBD +## 3.11.3 - 2022-06-13 -### Added - -- Nothing. - -### Changed -- Nothing. +----- -### Deprecated +### Release Notes for [3.11.3](https://github.com/laminas/laminas-servicemanager/milestone/25) -- Nothing. +3.11.x bugfix release (patch) -### Removed +### 3.11.3 -- Nothing. +- Total issues resolved: **0** +- Total pull requests resolved: **1** +- Total contributors: **1** -### Fixed +#### Bug -- Nothing. + - [133: Fixed namespace generation in `FactoryCreator` utility](https://github.com/laminas/laminas-servicemanager/pull/133) thanks to @adambalint-srg ## 3.11.2 - 2022-04-07