Passed
Push — v2 ( aacf1b...4bb499 )
by Daniel
05:01
created
src/Entity/Component/Collection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     /**
41 41
      * @ORM\Column(type="json", nullable=true)
42 42
      */
43
-    private ?array $defaultQueryParameters;
43
+    private ? array $defaultQueryParameters;
44 44
 
45 45
     /**
46 46
      * @ApiProperty(writable=false)
Please login to merge, or discard this patch.
src/Entity/Utility/UiTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,5 +26,5 @@
 block discarded – undo
26 26
     public ?string $uiComponent = null;
27 27
 
28 28
     /** @ORM\Column(type="json", nullable=true) */
29
-    public ?array $uiClassNames = null;
29
+    public ? array $uiClassNames = null;
30 30
 }
Please login to merge, or discard this patch.
src/Command/UserCreateCommand.php 5 patches
Indentation   -73 removed lines patch added patch discarded remove patch
@@ -49,76 +49,3 @@
 block discarded – undo
49 49
                 new InputOption('overwrite', null, InputOption::VALUE_NONE, 'Overwrite the user if they already exist'),
50 50
             ])
51 51
             ->setHelp(<<<'EOT'
52
-                The <info>silverback:api-component:user:create</info> command creates a user:
53
-                  <info>php %command.full_name% daniel</info>
54
-                This interactive shell will ask you for an email and then a password.
55
-                You can alternatively specify the email and password as the second and third arguments:
56
-                  <info>php %command.full_name% daniel [email protected] mypassword</info>
57
-                You can create a super admin via the super-admin flag:
58
-                  <info>php %command.full_name% admin --super-admin</info>
59
-                You can create an inactive user (will not be able to log in):
60
-                  <info>php %command.full_name% disabled_user --inactive</info>
61
-                You can overwrite a user if they already exist:
62
-                  <info>php %command.full_name% existing_username --overwrite</info>
63
-                EOT
64
-            );
65
-    }
66
-
67
-    /**
68
-     * {@inheritdoc}
69
-     */
70
-    protected function execute(InputInterface $input, OutputInterface $output): void
71
-    {
72
-        $username = (string) $input->getArgument('username');
73
-        $email = (string) $input->getArgument('email');
74
-        $password = (string) $input->getArgument('password');
75
-        $inactive = $input->getOption('inactive');
76
-        $superadmin = $input->getOption('super-admin');
77
-        $overwrite = $input->getOption('overwrite');
78
-
79
-        $this->userFactory->create($username, $password, $email, $inactive, $superadmin, $overwrite);
80
-
81
-        $output->writeln(sprintf('Created user <comment>%s</comment>', $username));
82
-    }
83
-
84
-    /**
85
-     * {@inheritdoc}
86
-     */
87
-    protected function interact(InputInterface $input, OutputInterface $output): void
88
-    {
89
-        $notEmptyValidator = static function (string $label) {
90
-            return static function (string $string) use ($label) {
91
-                if (empty($string)) {
92
-                    throw new Exception($label . ' can not be empty');
93
-                }
94
-
95
-                return $string;
96
-            };
97
-        };
98
-
99
-        $questions = [];
100
-
101
-        if (!$input->getArgument('username')) {
102
-            $question = new Question('Please choose a username:');
103
-            $question->setValidator($notEmptyValidator('Username'));
104
-            $questions['username'] = $question;
105
-        }
106
-
107
-        if (!$input->getArgument('email')) {
108
-            $question = new Question('Please choose an email (leave blank to use same as username):');
109
-            $questions['email'] = $question;
110
-        }
111
-
112
-        if (!$input->getArgument('password')) {
113
-            $question = new Question('Please choose a password:');
114
-            $question->setValidator($notEmptyValidator('Password'));
115
-            $question->setHidden(true);
116
-            $questions['password'] = $question;
117
-        }
118
-
119
-        foreach ($questions as $name => $question) {
120
-            $answer = $this->getHelper('question')->ask($input, $output, $question);
121
-            $input->setArgument($name, $answer);
122
-        }
123
-    }
124
-}
Please login to merge, or discard this patch.
Switch Indentation   -73 removed lines patch added patch discarded remove patch
@@ -49,76 +49,3 @@
 block discarded – undo
49 49
                 new InputOption('overwrite', null, InputOption::VALUE_NONE, 'Overwrite the user if they already exist'),
50 50
             ])
51 51
             ->setHelp(<<<'EOT'
52
-                The <info>silverback:api-component:user:create</info> command creates a user:
53
-                  <info>php %command.full_name% daniel</info>
54
-                This interactive shell will ask you for an email and then a password.
55
-                You can alternatively specify the email and password as the second and third arguments:
56
-                  <info>php %command.full_name% daniel [email protected] mypassword</info>
57
-                You can create a super admin via the super-admin flag:
58
-                  <info>php %command.full_name% admin --super-admin</info>
59
-                You can create an inactive user (will not be able to log in):
60
-                  <info>php %command.full_name% disabled_user --inactive</info>
61
-                You can overwrite a user if they already exist:
62
-                  <info>php %command.full_name% existing_username --overwrite</info>
63
-                EOT
64
-            );
65
-    }
66
-
67
-    /**
68
-     * {@inheritdoc}
69
-     */
70
-    protected function execute(InputInterface $input, OutputInterface $output): void
71
-    {
72
-        $username = (string) $input->getArgument('username');
73
-        $email = (string) $input->getArgument('email');
74
-        $password = (string) $input->getArgument('password');
75
-        $inactive = $input->getOption('inactive');
76
-        $superadmin = $input->getOption('super-admin');
77
-        $overwrite = $input->getOption('overwrite');
78
-
79
-        $this->userFactory->create($username, $password, $email, $inactive, $superadmin, $overwrite);
80
-
81
-        $output->writeln(sprintf('Created user <comment>%s</comment>', $username));
82
-    }
83
-
84
-    /**
85
-     * {@inheritdoc}
86
-     */
87
-    protected function interact(InputInterface $input, OutputInterface $output): void
88
-    {
89
-        $notEmptyValidator = static function (string $label) {
90
-            return static function (string $string) use ($label) {
91
-                if (empty($string)) {
92
-                    throw new Exception($label . ' can not be empty');
93
-                }
94
-
95
-                return $string;
96
-            };
97
-        };
98
-
99
-        $questions = [];
100
-
101
-        if (!$input->getArgument('username')) {
102
-            $question = new Question('Please choose a username:');
103
-            $question->setValidator($notEmptyValidator('Username'));
104
-            $questions['username'] = $question;
105
-        }
106
-
107
-        if (!$input->getArgument('email')) {
108
-            $question = new Question('Please choose an email (leave blank to use same as username):');
109
-            $questions['email'] = $question;
110
-        }
111
-
112
-        if (!$input->getArgument('password')) {
113
-            $question = new Question('Please choose a password:');
114
-            $question->setValidator($notEmptyValidator('Password'));
115
-            $question->setHidden(true);
116
-            $questions['password'] = $question;
117
-        }
118
-
119
-        foreach ($questions as $name => $question) {
120
-            $answer = $this->getHelper('question')->ask($input, $output, $question);
121
-            $input->setArgument($name, $answer);
122
-        }
123
-    }
124
-}
Please login to merge, or discard this patch.
Spacing   -73 removed lines patch added patch discarded remove patch
@@ -49,76 +49,3 @@
 block discarded – undo
49 49
                 new InputOption('overwrite', null, InputOption::VALUE_NONE, 'Overwrite the user if they already exist'),
50 50
             ])
51 51
             ->setHelp(<<<'EOT'
52
-                The <info>silverback:api-component:user:create</info> command creates a user:
53
-                  <info>php %command.full_name% daniel</info>
54
-                This interactive shell will ask you for an email and then a password.
55
-                You can alternatively specify the email and password as the second and third arguments:
56
-                  <info>php %command.full_name% daniel [email protected] mypassword</info>
57
-                You can create a super admin via the super-admin flag:
58
-                  <info>php %command.full_name% admin --super-admin</info>
59
-                You can create an inactive user (will not be able to log in):
60
-                  <info>php %command.full_name% disabled_user --inactive</info>
61
-                You can overwrite a user if they already exist:
62
-                  <info>php %command.full_name% existing_username --overwrite</info>
63
-                EOT
64
-            );
65
-    }
66
-
67
-    /**
68
-     * {@inheritdoc}
69
-     */
70
-    protected function execute(InputInterface $input, OutputInterface $output): void
71
-    {
72
-        $username = (string) $input->getArgument('username');
73
-        $email = (string) $input->getArgument('email');
74
-        $password = (string) $input->getArgument('password');
75
-        $inactive = $input->getOption('inactive');
76
-        $superadmin = $input->getOption('super-admin');
77
-        $overwrite = $input->getOption('overwrite');
78
-
79
-        $this->userFactory->create($username, $password, $email, $inactive, $superadmin, $overwrite);
80
-
81
-        $output->writeln(sprintf('Created user <comment>%s</comment>', $username));
82
-    }
83
-
84
-    /**
85
-     * {@inheritdoc}
86
-     */
87
-    protected function interact(InputInterface $input, OutputInterface $output): void
88
-    {
89
-        $notEmptyValidator = static function (string $label) {
90
-            return static function (string $string) use ($label) {
91
-                if (empty($string)) {
92
-                    throw new Exception($label . ' can not be empty');
93
-                }
94
-
95
-                return $string;
96
-            };
97
-        };
98
-
99
-        $questions = [];
100
-
101
-        if (!$input->getArgument('username')) {
102
-            $question = new Question('Please choose a username:');
103
-            $question->setValidator($notEmptyValidator('Username'));
104
-            $questions['username'] = $question;
105
-        }
106
-
107
-        if (!$input->getArgument('email')) {
108
-            $question = new Question('Please choose an email (leave blank to use same as username):');
109
-            $questions['email'] = $question;
110
-        }
111
-
112
-        if (!$input->getArgument('password')) {
113
-            $question = new Question('Please choose a password:');
114
-            $question->setValidator($notEmptyValidator('Password'));
115
-            $question->setHidden(true);
116
-            $questions['password'] = $question;
117
-        }
118
-
119
-        foreach ($questions as $name => $question) {
120
-            $answer = $this->getHelper('question')->ask($input, $output, $question);
121
-            $input->setArgument($name, $answer);
122
-        }
123
-    }
124
-}
Please login to merge, or discard this patch.
Braces   -73 removed lines patch added patch discarded remove patch
@@ -49,76 +49,3 @@
 block discarded – undo
49 49
                 new InputOption('overwrite', null, InputOption::VALUE_NONE, 'Overwrite the user if they already exist'),
50 50
             ])
51 51
             ->setHelp(<<<'EOT'
52
-                The <info>silverback:api-component:user:create</info> command creates a user:
53
-                  <info>php %command.full_name% daniel</info>
54
-                This interactive shell will ask you for an email and then a password.
55
-                You can alternatively specify the email and password as the second and third arguments:
56
-                  <info>php %command.full_name% daniel [email protected] mypassword</info>
57
-                You can create a super admin via the super-admin flag:
58
-                  <info>php %command.full_name% admin --super-admin</info>
59
-                You can create an inactive user (will not be able to log in):
60
-                  <info>php %command.full_name% disabled_user --inactive</info>
61
-                You can overwrite a user if they already exist:
62
-                  <info>php %command.full_name% existing_username --overwrite</info>
63
-                EOT
64
-            );
65
-    }
66
-
67
-    /**
68
-     * {@inheritdoc}
69
-     */
70
-    protected function execute(InputInterface $input, OutputInterface $output): void
71
-    {
72
-        $username = (string) $input->getArgument('username');
73
-        $email = (string) $input->getArgument('email');
74
-        $password = (string) $input->getArgument('password');
75
-        $inactive = $input->getOption('inactive');
76
-        $superadmin = $input->getOption('super-admin');
77
-        $overwrite = $input->getOption('overwrite');
78
-
79
-        $this->userFactory->create($username, $password, $email, $inactive, $superadmin, $overwrite);
80
-
81
-        $output->writeln(sprintf('Created user <comment>%s</comment>', $username));
82
-    }
83
-
84
-    /**
85
-     * {@inheritdoc}
86
-     */
87
-    protected function interact(InputInterface $input, OutputInterface $output): void
88
-    {
89
-        $notEmptyValidator = static function (string $label) {
90
-            return static function (string $string) use ($label) {
91
-                if (empty($string)) {
92
-                    throw new Exception($label . ' can not be empty');
93
-                }
94
-
95
-                return $string;
96
-            };
97
-        };
98
-
99
-        $questions = [];
100
-
101
-        if (!$input->getArgument('username')) {
102
-            $question = new Question('Please choose a username:');
103
-            $question->setValidator($notEmptyValidator('Username'));
104
-            $questions['username'] = $question;
105
-        }
106
-
107
-        if (!$input->getArgument('email')) {
108
-            $question = new Question('Please choose an email (leave blank to use same as username):');
109
-            $questions['email'] = $question;
110
-        }
111
-
112
-        if (!$input->getArgument('password')) {
113
-            $question = new Question('Please choose a password:');
114
-            $question->setValidator($notEmptyValidator('Password'));
115
-            $question->setHidden(true);
116
-            $questions['password'] = $question;
117
-        }
118
-
119
-        foreach ($questions as $name => $question) {
120
-            $answer = $this->getHelper('question')->ask($input, $output, $question);
121
-            $input->setArgument($name, $answer);
122
-        }
123
-    }
124
-}
Please login to merge, or discard this patch.
Upper-Lower-Casing   -73 removed lines patch added patch discarded remove patch
@@ -49,76 +49,3 @@
 block discarded – undo
49 49
                 new InputOption('overwrite', null, InputOption::VALUE_NONE, 'Overwrite the user if they already exist'),
50 50
             ])
51 51
             ->setHelp(<<<'EOT'
52
-                The <info>silverback:api-component:user:create</info> command creates a user:
53
-                  <info>php %command.full_name% daniel</info>
54
-                This interactive shell will ask you for an email and then a password.
55
-                You can alternatively specify the email and password as the second and third arguments:
56
-                  <info>php %command.full_name% daniel [email protected] mypassword</info>
57
-                You can create a super admin via the super-admin flag:
58
-                  <info>php %command.full_name% admin --super-admin</info>
59
-                You can create an inactive user (will not be able to log in):
60
-                  <info>php %command.full_name% disabled_user --inactive</info>
61
-                You can overwrite a user if they already exist:
62
-                  <info>php %command.full_name% existing_username --overwrite</info>
63
-                EOT
64
-            );
65
-    }
66
-
67
-    /**
68
-     * {@inheritdoc}
69
-     */
70
-    protected function execute(InputInterface $input, OutputInterface $output): void
71
-    {
72
-        $username = (string) $input->getArgument('username');
73
-        $email = (string) $input->getArgument('email');
74
-        $password = (string) $input->getArgument('password');
75
-        $inactive = $input->getOption('inactive');
76
-        $superadmin = $input->getOption('super-admin');
77
-        $overwrite = $input->getOption('overwrite');
78
-
79
-        $this->userFactory->create($username, $password, $email, $inactive, $superadmin, $overwrite);
80
-
81
-        $output->writeln(sprintf('Created user <comment>%s</comment>', $username));
82
-    }
83
-
84
-    /**
85
-     * {@inheritdoc}
86
-     */
87
-    protected function interact(InputInterface $input, OutputInterface $output): void
88
-    {
89
-        $notEmptyValidator = static function (string $label) {
90
-            return static function (string $string) use ($label) {
91
-                if (empty($string)) {
92
-                    throw new Exception($label . ' can not be empty');
93
-                }
94
-
95
-                return $string;
96
-            };
97
-        };
98
-
99
-        $questions = [];
100
-
101
-        if (!$input->getArgument('username')) {
102
-            $question = new Question('Please choose a username:');
103
-            $question->setValidator($notEmptyValidator('Username'));
104
-            $questions['username'] = $question;
105
-        }
106
-
107
-        if (!$input->getArgument('email')) {
108
-            $question = new Question('Please choose an email (leave blank to use same as username):');
109
-            $questions['email'] = $question;
110
-        }
111
-
112
-        if (!$input->getArgument('password')) {
113
-            $question = new Question('Please choose a password:');
114
-            $question->setValidator($notEmptyValidator('Password'));
115
-            $question->setHidden(true);
116
-            $questions['password'] = $question;
117
-        }
118
-
119
-        foreach ($questions as $name => $question) {
120
-            $answer = $this->getHelper('question')->ask($input, $output, $question);
121
-            $input->setArgument($name, $answer);
122
-        }
123
-    }
124
-}
Please login to merge, or discard this patch.