Skip to content

Commit 235c8a5

Browse files
Merge branch '7.3' into 7.4
* 7.3: [ObjectMapper] Fix test using LazyObjectInterface [Security] Fix added $token argument to UserCheckerInterface::checkPostAuth() minor symfony#61192 [ObjectMapper] add missing legacy group (xabbuh) bugfix(symfony#61139): Only generate an outputDir if none is set.
2 parents c6d8ce0 + 5bf8b3e commit 235c8a5

File tree

6 files changed

+39
-16
lines changed

6 files changed

+39
-16
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ public function checkPreAuth(UserInterface $user): void
995995
{
996996
}
997997

998-
public function checkPostAuth(UserInterface $user): void
998+
public function checkPostAuth(UserInterface $user, ?TokenInterface $token = null): void
999999
{
10001000
}
10011001
}

src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,12 @@ public function testSetExtraKeyMethodIsNotGeneratedWhenAllowExtraKeysIsFalse()
159159
*/
160160
private function generateConfigBuilder(string $configurationClass, ?string &$outputDir = null)
161161
{
162-
$outputDir = tempnam(sys_get_temp_dir(), 'sf_config_builder_');
163-
unlink($outputDir);
164-
mkdir($outputDir);
165-
$this->tempDir[] = $outputDir;
162+
if (null === $outputDir) {
163+
$outputDir = tempnam(sys_get_temp_dir(), 'sf_config_builder_');
164+
unlink($outputDir);
165+
mkdir($outputDir);
166+
$this->tempDir[] = $outputDir;
167+
}
166168

167169
$configuration = new $configurationClass();
168170
$rootNode = $configuration->getConfigTreeBuilder()->buildTree();

src/Symfony/Component/ObjectMapper/Tests/Fixtures/LazyFoo.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,28 @@
1111

1212
namespace Symfony\Component\ObjectMapper\Tests\Fixtures;
1313

14-
use Symfony\Component\VarExporter\LazyGhostTrait;
1514
use Symfony\Component\VarExporter\LazyObjectInterface;
1615

1716
class LazyFoo extends \stdClass implements LazyObjectInterface
1817
{
19-
use LazyGhostTrait;
18+
private bool $initialized = false;
2019

21-
public string $name = 'foo';
20+
public function isLazyObjectInitialized(bool $partial = false): bool
21+
{
22+
return $this->initialized;
23+
}
24+
25+
public function initializeLazyObject(): object
26+
{
27+
$this->initialized = true;
28+
29+
return $this;
30+
}
31+
32+
public function resetLazyObject(): bool
33+
{
34+
$this->initialized = false;
35+
36+
return true;
37+
}
2238
}

src/Symfony/Component/Security/Core/User/ChainUserChecker.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,15 @@ public function checkPreAuth(UserInterface $user): void
2929
}
3030
}
3131

32-
public function checkPostAuth(UserInterface $user /* , TokenInterface $token */): void
32+
/**
33+
* @param ?TokenInterface $token
34+
*/
35+
public function checkPostAuth(UserInterface $user /* , ?TokenInterface $token = null */): void
3336
{
3437
$token = 1 < \func_num_args() ? func_get_arg(1) : null;
3538

3639
foreach ($this->checkers as $checker) {
37-
if ($token instanceof TokenInterface) {
38-
$checker->checkPostAuth($user, $token);
39-
} else {
40-
$checker->checkPostAuth($user);
41-
}
40+
$checker->checkPostAuth($user, $token);
4241
}
4342
}
4443
}

src/Symfony/Component/Security/Core/User/InMemoryUserChecker.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ public function checkPreAuth(UserInterface $user): void
3333
}
3434
}
3535

36-
public function checkPostAuth(UserInterface $user): void
36+
/**
37+
* @param ?TokenInterface $token
38+
*/
39+
public function checkPostAuth(UserInterface $user /* , ?TokenInterface $token = null */): void
3740
{
3841
}
3942
}

src/Symfony/Component/Security/Core/User/UserCheckerInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Security\Core\User;
1313

14+
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1415
use Symfony\Component\Security\Core\Exception\AccountStatusException;
1516

1617
/**
@@ -33,7 +34,9 @@ public function checkPreAuth(UserInterface $user): void;
3334
/**
3435
* Checks the user account after authentication.
3536
*
37+
* @param ?TokenInterface $token
38+
*
3639
* @throws AccountStatusException
3740
*/
38-
public function checkPostAuth(UserInterface $user /* , TokenInterface $token */): void;
41+
public function checkPostAuth(UserInterface $user /* , ?TokenInterface $token = null */): void;
3942
}

0 commit comments

Comments
 (0)