Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bumped laminas-servicemanager to v4 alongside its dependencies, remov… #103

Open
wants to merge 8 commits into
base: 3.0.x
Choose a base branch
from

Conversation

Jurj-Bogdan
Copy link
Contributor

Upgraded laminas/laminas-servicemanager to version 4, as well as the other dependencies required for it, and added various Psalm tweaks.

I seems I was working on this PR alongside #102 , with the main difference seemingly being the removal of v2 functions from the codebase in preparation for a new major release.

I was about to make a different PR to the current branch marking the functions removed here as deprecated, but I'll wait for feedback regarding the desired way forward.

Jurj-Bogdan and others added 4 commits January 24, 2025 12:25
@arhimede
Copy link
Member

@Jurj-Bogdan See #102
Please open a separate PR, which do not break BC , and against 2.23 branch, for the milestone 2.23.1

@arhimede
Copy link
Member

arhimede commented Feb 4, 2025

@laminas/technical-steering-committee
We have this PR and the other PR, #102
which are doing the same thing.
Only that this PR is removing the deprecated function .

So, should I create the branch 3.0.x and merge this one there ?

@gsteel
Copy link
Member

gsteel commented Feb 4, 2025

So, should I create the branch 3.0.x and merge this one there

Yes, create 3.0.x from the tip of the next minor release - You should probably get 2.24.x patches resolved first such as #106 so that merge-ups from 2.x have fewer conflicts

@arhimede arhimede added this to the 3.0.0 milestone Feb 5, 2025
@arhimede arhimede changed the base branch from 2.24.x to 3.0.x February 5, 2025 10:58
@arhimede
Copy link
Member

arhimede commented Feb 5, 2025

@Jurj-Bogdan Please fix the conflicts

renovate bot and others added 4 commits February 6, 2025 11:48
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ed deprecated usage functions

Signed-off-by: Jurj-Bogdan <[email protected]>
@arhimede arhimede requested a review from gsteel February 6, 2025 21:08
*/
protected $sessionSavePath;
protected string $sessionSavePath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property is initially null - it is not set in the constructor

*/
protected $sessionName;
protected string $sessionName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property is initially null - it is not set in the constructor

*/
public function setCacheStorage(CacheStorage $cacheStorage)
public function setCacheStorage(CacheStorage $cacheStorage): Cache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be deprecated and dropped and the constructor changed to use property promotion

@@ -41,28 +40,20 @@ class ContainerAbstractServiceFactory implements AbstractFactoryInterface
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class should be made final and all properties private. You should also mark this class soft final with @final in a 2.x release

*/
protected $config;
protected array $config = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prop is not set in a constructor, so it's type should be array|null


/** @param OptionsArgument $options */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert as per comment on class-level doc-block

* session?: Container,
* timeout?: ?int,
* }
*/
final class Csrf extends AbstractValidator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole class will probably need further refactoring such as deprecating and dropping all the public setters and getters

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not suggesting that work should happen in this patch tho!

@@ -114,7 +114,8 @@ public function testFactoryWillAddValidatorViaConfiguration(): void

$manager->start();

$chain = $manager->getValidatorChain();
$chain = $manager->getValidatorChain();
/** @psalm-suppress ArgumentTypeCoercion **/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this suppression and replace it with assertions.

Assert the manager is ManagerInterface
Assert the chain is a EventManagerInterface or whatever it's supposed to be

@@ -198,7 +199,8 @@ public function testFactoryDoesNotAttachValidatorTwoTimes(): void
// Ignore exception, because we are not interested whether session validation passes in this test
}

$chain = $manager->getValidatorChain();
$chain = $manager->getValidatorChain();
/** @psalm-suppress ArgumentTypeCoercion **/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here… More assertions!

@@ -1019,6 +963,11 @@
<code><![CDATA[CallbackHandler]]></code>
</UndefinedDocblockClass>
</file>
<file src="src/Validator/Csrf.php">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really shouldn't be expanding the baseline while moving towards 3 - This is likely due to dropping the defined array shape on the CSRF validator

@gsteel gsteel added Enhancement Dependencies Updates and changes to dependencies labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Updates and changes to dependencies Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement service manager 4
3 participants