File tree 3 files changed +4
-7
lines changed
3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public function __construct(array $source)
33
33
*/
34
34
public function getDefinition (string $ name ): ?DefinitionInterface
35
35
{
36
- return $ this ->source [$ name ] ?? $ this -> source [ $ name ] = $ this ->autowire ($ name );
36
+ return $ this ->source [$ name ] ??= $ this ->autowire ($ name );
37
37
}
38
38
39
39
/**
Original file line number Diff line number Diff line change @@ -53,11 +53,7 @@ public function setClassName(string $className = null): void
53
53
54
54
public function getClassName (): string
55
55
{
56
- if ($ this ->className !== null ) {
57
- return $ this ->className ;
58
- }
59
-
60
- return $ this ->name ;
56
+ return $ this ->className ?? $ this ->name ;
61
57
}
62
58
63
59
public function isClassExists (): bool
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ protected function tearDown(): void
29
29
public function testGetDefinition ()
30
30
{
31
31
$ source = new DefinitionSource ([]);
32
- $ source ->getDefinition (Bar::class);
32
+ $ bar = $ source ->getDefinition (Bar::class);
33
33
$ this ->assertSame (1 , count ($ source ->getDefinitions ()));
34
+ $ this ->assertSame ($ bar , $ source ->getDefinition (Bar::class));
34
35
}
35
36
}
You can’t perform that action at this time.
0 commit comments