Total Complexity | 4 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class ConsoleUserProvider implements UserProviderInterface |
||
13 | { |
||
14 | private ?string $currentCommand = null; |
||
15 | |||
16 | public function __invoke(): ?UserInterface |
||
17 | { |
||
18 | if (null === $this->currentCommand) { |
||
19 | return null; |
||
20 | } |
||
21 | |||
22 | return new User( |
||
23 | 'command', |
||
24 | $this->currentCommand ?? '' |
||
25 | ); |
||
26 | } |
||
27 | |||
28 | public function setCurrentCommand(?Command $command): void |
||
34 | } |
||
35 | } |
||
37 |