File tree Expand file tree Collapse file tree 6 files changed +39
-16
lines changed
Bundle/SecurityBundle/Tests/DependencyInjection
ObjectMapper/Tests/Fixtures Expand file tree Collapse file tree 6 files changed +39
-16
lines changed Original file line number Diff line number Diff line change @@ -995,7 +995,7 @@ public function checkPreAuth(UserInterface $user): void
995
995
{
996
996
}
997
997
998
- public function checkPostAuth (UserInterface $ user ): void
998
+ public function checkPostAuth (UserInterface $ user, ? TokenInterface $ token = null ): void
999
999
{
1000
1000
}
1001
1001
}
Original file line number Diff line number Diff line change @@ -159,10 +159,12 @@ public function testSetExtraKeyMethodIsNotGeneratedWhenAllowExtraKeysIsFalse()
159
159
*/
160
160
private function generateConfigBuilder (string $ configurationClass , ?string &$ outputDir = null )
161
161
{
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
+ }
166
168
167
169
$ configuration = new $ configurationClass ();
168
170
$ rootNode = $ configuration ->getConfigTreeBuilder ()->buildTree ();
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \ObjectMapper \Tests \Fixtures ;
13
13
14
- use Symfony \Component \VarExporter \LazyGhostTrait ;
15
14
use Symfony \Component \VarExporter \LazyObjectInterface ;
16
15
17
16
class LazyFoo extends \stdClass implements LazyObjectInterface
18
17
{
19
- use LazyGhostTrait ;
18
+ private bool $ initialized = false ;
20
19
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
+ }
22
38
}
Original file line number Diff line number Diff line change @@ -29,16 +29,15 @@ public function checkPreAuth(UserInterface $user): void
29
29
}
30
30
}
31
31
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
33
36
{
34
37
$ token = 1 < \func_num_args () ? func_get_arg (1 ) : null ;
35
38
36
39
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 );
42
41
}
43
42
}
44
43
}
Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ public function checkPreAuth(UserInterface $user): void
33
33
}
34
34
}
35
35
36
- public function checkPostAuth (UserInterface $ user ): void
36
+ /**
37
+ * @param ?TokenInterface $token
38
+ */
39
+ public function checkPostAuth (UserInterface $ user /* , ?TokenInterface $token = null */ ): void
37
40
{
38
41
}
39
42
}
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Security \Core \User ;
13
13
14
+ use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
14
15
use Symfony \Component \Security \Core \Exception \AccountStatusException ;
15
16
16
17
/**
@@ -33,7 +34,9 @@ public function checkPreAuth(UserInterface $user): void;
33
34
/**
34
35
* Checks the user account after authentication.
35
36
*
37
+ * @param ?TokenInterface $token
38
+ *
36
39
* @throws AccountStatusException
37
40
*/
38
- public function checkPostAuth (UserInterface $ user /* , TokenInterface $token */ ): void ;
41
+ public function checkPostAuth (UserInterface $ user /* , ? TokenInterface $token = null */ ): void ;
39
42
}
You can’t perform that action at this time.
0 commit comments