Skip to content

Commit 6b429e8

Browse files
authored
Simplifying - no output - just return string
1 parent 197a2bf commit 6b429e8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Security/InteractiveSecurityHelper.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,24 @@ public function guessUserClass(SymfonyStyle $io, array $providers, string $quest
9292

9393
$userClass = $io->ask(
9494
$questionText ?? 'Enter the User class that you want to authenticate (e.g. <fg=yellow>App\\Entity\\User</>)',
95-
$this->guessUserClassDefault($io),
95+
$this->guessUserClassDefault(),
9696
[Validator::class, 'classIsUserInterface']
9797
);
9898

9999
return $userClass;
100100
}
101101

102-
private function guessUserClassDefault(SymfonyStyle $io)
102+
private function guessUserClassDefault(): string
103103
{
104104
if (class_exists('App\\Entity\\User') && isset(class_implements('App\\Entity\\User')[UserInterface::class])) {
105-
$io->note('Found a default class App\\Entity\\User');
106-
107105
return 'App\\Entity\\User';
108106
}
109107

110108
if (class_exists('App\\Security\\User') && isset(class_implements('App\\Security\\User')[UserInterface::class])) {
111-
$io->note('Found a default class App\\Security\\User');
112-
113109
return 'App\\Security\\User';
114110
}
115111

116-
return $io->error('This value cannot be blank and no default class found');
112+
return '';
117113
}
118114

119115
public function guessUserNameField(SymfonyStyle $io, string $userClass, array $providers): string

0 commit comments

Comments
 (0)