Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Lock] AddLockKeyNormalizer#60023

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
valtzu wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromvaltzu:lock-normalizer

Conversation

valtzu
Copy link
Contributor

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
LicenseMIT

The Lock documentation mentions that the lock keys are serializable – however, it seems that's the case only if you're using native php serializer.

I'm proposing to addLockKeyNormalizer to make the example in the docs work the same when using Symfony Serializer too.

@carsonbotcarsonbot added this to the7.3 milestoneMar 23, 2025
@valtzuvaltzuforce-pushed thelock-normalizer branch 2 times, most recently from89d05b7 tod1cd6e1CompareMarch 23, 2025 12:51
{
$key = (new \ReflectionClass(Key::class))->newInstanceWithoutConstructor();
foreach ($key->__sleep() as $serializedField) {
(fn () => $this->$serializedField = $data[$serializedField])->bindTo($key, Key::class)();

Choose a reason for hiding this comment

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

it should be more efficient to have one closure outside of the loop instead of many calls inside

valtzu reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, done.

$this->assertEqualsWithDelta($key->getRemainingLifetime(), $copy->getRemainingLifetime(), 0.001);
}

public function testDenormalize()
Copy link
Member

Choose a reason for hiding this comment

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

This test name as bad as this test is not covering denormalization at all.

valtzu reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, fixed

@@ -2128,6 +2129,11 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
{
$loader->load('lock.php');

// BC layer Lock < 7.3
if (!class_exists(DenormalizerInterface::class) || !class_exists(LockKeyNormalizer::class)) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (!class_exists(DenormalizerInterface::class) || !class_exists(LockKeyNormalizer::class)) {
if (!interface_exists(DenormalizerInterface::class) || !class_exists(LockKeyNormalizer::class)) {

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Fixed

@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof left review comments

@jderussejderusseAwaiting requested review from jderussejderusse is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

5 participants
@valtzu@nicolas-grekas@stof@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp