2525
2626use function implode ;
2727use function sprintf ;
28+ use function trim ;
2829
2930use const PHP_EOL ;
3031
@@ -75,6 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7576 $ messages = [];
7677 foreach ($ inputFilter ->getMessages () as $ field => $ errors ) {
7778 foreach ($ errors as $ error ) {
79+ /** @var scalar $error */
7880 $ messages [] = sprintf ('%s: %s ' , $ field , $ error );
7981 }
8082 }
@@ -90,6 +92,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9092 }
9193
9294 /**
95+ * @return array{
96+ * identity: string,
97+ * password: string,
98+ * passwordConfirm: string,
99+ * firstName: string,
100+ * lastName: string,
101+ * status: 'active',
102+ * roles: array{uuid: non-empty-string}[],
103+ * }
93104 * @throws Exception
94105 */
95106 private function getData (InputInterface $ input ): array
@@ -100,11 +111,11 @@ private function getData(InputInterface $input): array
100111 }
101112
102113 return [
103- 'identity ' => $ input ->getOption ('identity ' ),
104- 'password ' => $ input ->getOption ('password ' ),
105- 'passwordConfirm ' => $ input ->getOption ('password ' ),
106- 'firstName ' => $ input ->getOption ('firstName ' ),
107- 'lastName ' => $ input ->getOption ('lastName ' ),
114+ 'identity ' => trim ( $ input ->getOption ('identity ' ) ),
115+ 'password ' => trim ( $ input ->getOption ('password ' ) ),
116+ 'passwordConfirm ' => trim ( $ input ->getOption ('password ' ) ),
117+ 'firstName ' => trim ( $ input ->getOption ('firstName ' ) ),
118+ 'lastName ' => trim ( $ input ->getOption ('lastName ' ) ),
108119 'status ' => AdminStatusEnum::Active->value ,
109120 'roles ' => [
110121 ['uuid ' => $ adminRole ->getUuid ()->toString ()],
0 commit comments