@@ -104,8 +104,8 @@ |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | - * @param PreFileDownloadEvent $event |
|
| 108 | - */ |
|
| 107 | + * @param PreFileDownloadEvent $event |
|
| 108 | + */ |
|
| 109 | 109 | public function onPreFileDownload(PreFileDownloadEvent $event) |
| 110 | 110 | { |
| 111 | 111 | /*$protocol = parse_url($event->getProcessedUrl(), PHP_URL_SCHEME); |
@@ -37,8 +37,7 @@ discard block |
||
| 37 | 37 | * @param Composer $composer |
| 38 | 38 | * @param IOInterface $io |
| 39 | 39 | */ |
| 40 | - public function activate(Composer $composer, IOInterface $io) |
|
| 41 | - { |
|
| 40 | + public function activate(Composer $composer, IOInterface $io) { |
|
| 42 | 41 | $this->composer = $composer; |
| 43 | 42 | $this->io = $io; |
| 44 | 43 | //print 'Hello peoples...'; |
@@ -49,8 +48,7 @@ discard block |
||
| 49 | 48 | /** |
| 50 | 49 | * @return array |
| 51 | 50 | */ |
| 52 | - public function getCapabilities() |
|
| 53 | - { |
|
| 51 | + public function getCapabilities() { |
|
| 54 | 52 | return [ |
| 55 | 53 | 'Composer\Plugin\Capability\CommandProvider' => 'MyAdmin\Plugins\CommandProvider' |
| 56 | 54 | ]; |
@@ -94,8 +92,7 @@ discard block |
||
| 94 | 92 | * command occurs before any Composer Command is executed on the CLI. It provides you with access to the input and output objects of the program. |
| 95 | 93 | * pre-file-download occurs before files are downloaded and allows you to manipulate the RemoteFilesystem object prior to downloading files based on the URL to be downloaded. |
| 96 | 94 | */ |
| 97 | - public static function getSubscribedEvents() |
|
| 98 | - { |
|
| 95 | + public static function getSubscribedEvents() { |
|
| 99 | 96 | return [ |
| 100 | 97 | PluginEvents::PRE_FILE_DOWNLOAD => [ |
| 101 | 98 | ['onPreFileDownload', 0] |
@@ -106,8 +103,7 @@ discard block |
||
| 106 | 103 | /** |
| 107 | 104 | * @param PreFileDownloadEvent $event |
| 108 | 105 | */ |
| 109 | - public function onPreFileDownload(PreFileDownloadEvent $event) |
|
| 110 | - { |
|
| 106 | + public function onPreFileDownload(PreFileDownloadEvent $event) { |
|
| 111 | 107 | /*$protocol = parse_url($event->getProcessedUrl(), PHP_URL_SCHEME); |
| 112 | 108 | if ($protocol === 's3') { |
| 113 | 109 | $awsClient = new AwsClient($this->io, $this->composer->getConfig()); |
@@ -122,8 +118,7 @@ discard block |
||
| 122 | 118 | * @param Event $event |
| 123 | 119 | * @return void |
| 124 | 120 | */ |
| 125 | - public static function setPermissions(Event $event) |
|
| 126 | - { |
|
| 121 | + public static function setPermissions(Event $event) { |
|
| 127 | 122 | if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) { |
| 128 | 123 | $event->getIO()->write('<info>No permissions setup is required on Windows.</info>'); |
| 129 | 124 | return; |
@@ -150,8 +145,7 @@ discard block |
||
| 150 | 145 | * @param Event $event |
| 151 | 146 | * @return array an array of directory paths |
| 152 | 147 | */ |
| 153 | - public static function getWritableDirs(Event $event) |
|
| 154 | - { |
|
| 148 | + public static function getWritableDirs(Event $event) { |
|
| 155 | 149 | $configuration = $event->getComposer()->getPackage()->getExtra(); |
| 156 | 150 | if (!isset($configuration['writable-dirs'])) { |
| 157 | 151 | throw new \Exception('The writable-dirs must be specified in composer arbitrary extra data.'); |
@@ -168,8 +162,7 @@ discard block |
||
| 168 | 162 | * @param Event $event |
| 169 | 163 | * @return array an array of file paths |
| 170 | 164 | */ |
| 171 | - public static function getWritableFiles(Event $event) |
|
| 172 | - { |
|
| 165 | + public static function getWritableFiles(Event $event) { |
|
| 173 | 166 | $configuration = $event->getComposer()->getPackage()->getExtra(); |
| 174 | 167 | if (!isset($configuration['writable-files'])) { |
| 175 | 168 | throw new \Exception('The writable-files must be specified in composer arbitrary extra data.'); |
@@ -185,8 +178,7 @@ discard block |
||
| 185 | 178 | * |
| 186 | 179 | * @param Event $event |
| 187 | 180 | */ |
| 188 | - public static function setPermissionsSetfacl(Event $event) |
|
| 189 | - { |
|
| 181 | + public static function setPermissionsSetfacl(Event $event) { |
|
| 190 | 182 | $http_user = self::getHttpdUser($event); |
| 191 | 183 | foreach (self::getWritableDirs($event) as $path) { |
| 192 | 184 | self::SetfaclPermissionsSetter($event, $http_user, $path); |
@@ -201,8 +193,7 @@ discard block |
||
| 201 | 193 | * |
| 202 | 194 | * @param Event $event |
| 203 | 195 | */ |
| 204 | - public static function setPermissionsChmod(Event $event) |
|
| 205 | - { |
|
| 196 | + public static function setPermissionsChmod(Event $event) { |
|
| 206 | 197 | $http_user = self::getHttpdUser($event); |
| 207 | 198 | foreach (self::getWritableDirs($event) as $path) { |
| 208 | 199 | self::ChmodPermissionsSetter($event, $http_user, $path, 'dir'); |
@@ -218,8 +209,7 @@ discard block |
||
| 218 | 209 | * @param Event $event |
| 219 | 210 | * @return string the webserver username |
| 220 | 211 | */ |
| 221 | - public static function getHttpdUser(Event $event) |
|
| 222 | - { |
|
| 212 | + public static function getHttpdUser(Event $event) { |
|
| 223 | 213 | $ps = self::runProcess($event, 'ps aux'); |
| 224 | 214 | preg_match_all('/^.*([a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx)$/m', $ps, $matches); |
| 225 | 215 | foreach ($matches[0] as $match) { |
@@ -237,8 +227,7 @@ discard block |
||
| 237 | 227 | * @param string $http_user the webserver username |
| 238 | 228 | * @param string $path the directory to set permissions on |
| 239 | 229 | */ |
| 240 | - public static function SetfaclPermissionsSetter(Event $event, $http_user, $path) |
|
| 241 | - { |
|
| 230 | + public static function SetfaclPermissionsSetter(Event $event, $http_user, $path) { |
|
| 242 | 231 | self::EnsureDirExists($event, $path); |
| 243 | 232 | self::runProcess($event, 'setfacl -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path); |
| 244 | 233 | self::runProcess($event, 'setfacl -d -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path); |
@@ -252,8 +241,7 @@ discard block |
||
| 252 | 241 | * @param string $path the directory to set permissions on |
| 253 | 242 | * @param string $type optional type of entry, defaults to dir, can be dir or file |
| 254 | 243 | */ |
| 255 | - public static function ChmodPermissionsSetter(Event $event, $http_user, $path, $type = 'dir') |
|
| 256 | - { |
|
| 244 | + public static function ChmodPermissionsSetter(Event $event, $http_user, $path, $type = 'dir') { |
|
| 257 | 245 | if ($type == 'dir') { |
| 258 | 246 | self::EnsureDirExists($event, $path); |
| 259 | 247 | // self::runProcess($event, 'chmod +a "'.$http_user.' allow delete,write,append,file_inherit,directory_inherit" '.$path); |
@@ -272,8 +260,7 @@ discard block |
||
| 272 | 260 | * @param string $path the directory |
| 273 | 261 | * @throws \Exception |
| 274 | 262 | */ |
| 275 | - public static function EnsureDirExists(Event $event, $path) |
|
| 276 | - { |
|
| 263 | + public static function EnsureDirExists(Event $event, $path) { |
|
| 277 | 264 | if (!is_dir($path)) { |
| 278 | 265 | mkdir($path, 0777, true); |
| 279 | 266 | if (!is_dir($path)) { |
@@ -292,8 +279,7 @@ discard block |
||
| 292 | 279 | * @param string $path the directory |
| 293 | 280 | * @throws \Exception |
| 294 | 281 | */ |
| 295 | - public static function EnsureFileExists(Event $event, $path) |
|
| 296 | - { |
|
| 282 | + public static function EnsureFileExists(Event $event, $path) { |
|
| 297 | 283 | if (!is_dir(dirname($path))) { |
| 298 | 284 | mkdir(dirname($path), 0777, true); |
| 299 | 285 | touch($path); |
@@ -314,8 +300,7 @@ discard block |
||
| 314 | 300 | * @return string the output |
| 315 | 301 | * @throws \Exception |
| 316 | 302 | */ |
| 317 | - public static function runProcess(Event $event, $commandline) |
|
| 318 | - { |
|
| 303 | + public static function runProcess(Event $event, $commandline) { |
|
| 319 | 304 | if ($event->getIO()->isVerbose() === true) { |
| 320 | 305 | $event->getIO()->write(sprintf('Running <info>%s</info>', $commandline)); |
| 321 | 306 | } |
@@ -18,14 +18,12 @@ |
||
| 18 | 18 | * |
| 19 | 19 | * @package MyAdmin\Plugins |
| 20 | 20 | */ |
| 21 | -class TemplateInstallerPlugin implements PluginInterface |
|
| 22 | -{ |
|
| 21 | +class TemplateInstallerPlugin implements PluginInterface { |
|
| 23 | 22 | /** |
| 24 | 23 | * @param \Composer\Composer $composer |
| 25 | 24 | * @param \Composer\IO\IOInterface $io |
| 26 | 25 | */ |
| 27 | - public function activate(Composer $composer, IOInterface $io) |
|
| 28 | - { |
|
| 26 | + public function activate(Composer $composer, IOInterface $io) { |
|
| 29 | 27 | $installer = new TemplateInstaller($io, $composer); |
| 30 | 28 | $composer->getInstallationManager()->addInstaller($installer); |
| 31 | 29 | } |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | * @param array|bool $settings |
| 15 | 15 | * @return void |
| 16 | 16 | */ |
| 17 | -function register_module($module, $settings = false) |
|
| 18 | -{ |
|
| 17 | +function register_module($module, $settings = false) { |
|
| 19 | 18 | if ($settings === false) { |
| 20 | 19 | $settings = []; |
| 21 | 20 | } |
@@ -32,8 +31,7 @@ discard block |
||
| 32 | 31 | * @param string $module |
| 33 | 32 | * @return array |
| 34 | 33 | */ |
| 35 | -function get_module_stuff($module = 'default') |
|
| 36 | -{ |
|
| 34 | +function get_module_stuff($module = 'default') { |
|
| 37 | 35 | $module = get_module_name($module); |
| 38 | 36 | return [ |
| 39 | 37 | get_module_db($module), |
@@ -49,8 +47,7 @@ discard block |
||
| 49 | 47 | * @param string $module the module name your attempting to validate / get the name of |
| 50 | 48 | * @return string the name of the module |
| 51 | 49 | */ |
| 52 | -function get_module_name($module = 'default') |
|
| 53 | -{ |
|
| 50 | +function get_module_name($module = 'default') { |
|
| 54 | 51 | if ($module != 'default') { |
| 55 | 52 | if (isset($GLOBALS[$module.'_dbh'])) { |
| 56 | 53 | return $module; |
@@ -80,8 +77,7 @@ discard block |
||
| 80 | 77 | * @param bool|string $setting optional parameter, false to return all settings, or a specific setting name to return that setting |
| 81 | 78 | * @return array|false array of settings or false if no setting |
| 82 | 79 | */ |
| 83 | -function get_module_settings($module = 'default', $setting = false) |
|
| 84 | -{ |
|
| 80 | +function get_module_settings($module = 'default', $setting = false) { |
|
| 85 | 81 | if (!isset($GLOBALS['modules'][$module])) { |
| 86 | 82 | $keys = array_keys($GLOBALS['modules']); |
| 87 | 83 | $module = $keys[0]; |
@@ -101,8 +97,7 @@ discard block |
||
| 101 | 97 | * @param $service |
| 102 | 98 | * @return mixed |
| 103 | 99 | */ |
| 104 | -function get_service_define($service) |
|
| 105 | -{ |
|
| 100 | +function get_service_define($service) { |
|
| 106 | 101 | return $GLOBALS['tf']->get_service_define($service); |
| 107 | 102 | } |
| 108 | 103 | |
@@ -110,8 +105,7 @@ discard block |
||
| 110 | 105 | * @param $module |
| 111 | 106 | * @return bool |
| 112 | 107 | */ |
| 113 | -function has_module_db($module) |
|
| 114 | -{ |
|
| 108 | +function has_module_db($module) { |
|
| 115 | 109 | return isset($GLOBALS[$module.'_dbh']); |
| 116 | 110 | } |
| 117 | 111 | |
@@ -121,8 +115,7 @@ discard block |
||
| 121 | 115 | * @param string $module the name of the module to get the dbh for |
| 122 | 116 | * @return Db the database handler resource |
| 123 | 117 | */ |
| 124 | -function get_module_db($module) |
|
| 125 | -{ |
|
| 118 | +function get_module_db($module) { |
|
| 126 | 119 | if ($module == 'powerdns') { |
| 127 | 120 | if (!isset($GLOBALS['powerdns_dbh'])) { |
| 128 | 121 | $GLOBALS['powerdns_dbh'] = new \MyDb\Mdb2\Db(POWERDNS_DB, POWERDNS_USER, POWERDNS_PASSWORD, POWERDNS_HOST); |
@@ -148,8 +141,7 @@ discard block |
||
| 148 | 141 | * @param string $module |
| 149 | 142 | * @return string the/a validated module name |
| 150 | 143 | */ |
| 151 | -function get_valid_module($module = 'default') |
|
| 152 | -{ |
|
| 144 | +function get_valid_module($module = 'default') { |
|
| 153 | 145 | if (isset($GLOBALS['modules'][$module])) { |
| 154 | 146 | return $module; |
| 155 | 147 | } else { |
@@ -21,16 +21,14 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * MyAdmin Installer Plugin |
| 23 | 23 | */ |
| 24 | -class InstallerPlugin implements PluginInterface |
|
| 25 | -{ |
|
| 24 | +class InstallerPlugin implements PluginInterface { |
|
| 26 | 25 | /** |
| 27 | 26 | * Apply plugin modifications to Composer |
| 28 | 27 | * |
| 29 | 28 | * @param \Composer\Composer $composer |
| 30 | 29 | * @param \Composer\IO\IOInterface $io |
| 31 | 30 | */ |
| 32 | - public function activate(Composer $composer, IOInterface $io) |
|
| 33 | - { |
|
| 31 | + public function activate(Composer $composer, IOInterface $io) { |
|
| 34 | 32 | $installer = new Installer($io, $composer); |
| 35 | 33 | $composer->getInstallationManager()->addInstaller($installer); |
| 36 | 34 | } |
@@ -18,10 +18,8 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @package MyAdmin\Plugins\Command |
| 20 | 20 | */ |
| 21 | -class SetPermissions extends BaseCommand |
|
| 22 | -{ |
|
| 23 | - protected function configure() |
|
| 24 | - { |
|
| 21 | +class SetPermissions extends BaseCommand { |
|
| 22 | + protected function configure() { |
|
| 25 | 23 | $this |
| 26 | 24 | ->setName('myadmin:set-permissions') // the name of the command (the part after "bin/console") |
| 27 | 25 | ->setDescription('Creates and Sets Writable Permissions on Required Dirs') // the short description shown while running "php bin/console list" |
@@ -35,8 +33,7 @@ discard block |
||
| 35 | 33 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 36 | 34 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 37 | 35 | */ |
| 38 | - protected function initialize(InputInterface $input, OutputInterface $output) |
|
| 39 | - { |
|
| 36 | + protected function initialize(InputInterface $input, OutputInterface $output) { |
|
| 40 | 37 | } |
| 41 | 38 | |
| 42 | 39 | /** (optional) |
@@ -48,8 +45,7 @@ discard block |
||
| 48 | 45 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 49 | 46 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 50 | 47 | */ |
| 51 | - protected function interact(InputInterface $input, OutputInterface $output) |
|
| 52 | - { |
|
| 48 | + protected function interact(InputInterface $input, OutputInterface $output) { |
|
| 53 | 49 | } |
| 54 | 50 | |
| 55 | 51 | |
@@ -60,8 +56,7 @@ discard block |
||
| 60 | 56 | * @param InputInterface $input |
| 61 | 57 | * @param OutputInterface $output |
| 62 | 58 | */ |
| 63 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 64 | - { |
|
| 59 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 65 | 60 | \MyAdmin\Plugins\Plugin::setPermissions(); |
| 66 | 61 | } |
| 67 | 62 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | protected function execute(InputInterface $input, OutputInterface $output) |
| 71 | 71 | { |
| 72 | - $output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line) |
|
| 72 | + $output->writeln([// outputs multiple lines to the console (adding "\n" at the end of each line) |
|
| 73 | 73 | 'MyAdmin DocBlock Parser', |
| 74 | 74 | '=======================', |
| 75 | 75 | '' |
@@ -25,10 +25,8 @@ discard block |
||
| 25 | 25 | * Question Helper - http://symfony.com/doc/current/components/console/helpers/questionhelper.html |
| 26 | 26 | * |
| 27 | 27 | */ |
| 28 | -class Parse extends BaseCommand |
|
| 29 | -{ |
|
| 30 | - protected function configure() |
|
| 31 | - { |
|
| 28 | +class Parse extends BaseCommand { |
|
| 29 | + protected function configure() { |
|
| 32 | 30 | $this |
| 33 | 31 | ->setName('myadmin:parse') // the name of the command (the part after "bin/console") |
| 34 | 32 | ->setDescription('Parses PHP DocBlocks') // the short description shown while running "php bin/console list" |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 43 | 41 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 44 | 42 | */ |
| 45 | - protected function initialize(InputInterface $input, OutputInterface $output) |
|
| 46 | - { |
|
| 43 | + protected function initialize(InputInterface $input, OutputInterface $output) { |
|
| 47 | 44 | } |
| 48 | 45 | |
| 49 | 46 | /** (optional) |
@@ -55,8 +52,7 @@ discard block |
||
| 55 | 52 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 56 | 53 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 57 | 54 | */ |
| 58 | - protected function interact(InputInterface $input, OutputInterface $output) |
|
| 59 | - { |
|
| 55 | + protected function interact(InputInterface $input, OutputInterface $output) { |
|
| 60 | 56 | } |
| 61 | 57 | |
| 62 | 58 | |
@@ -67,8 +63,7 @@ discard block |
||
| 67 | 63 | * @param InputInterface $input |
| 68 | 64 | * @param OutputInterface $output |
| 69 | 65 | */ |
| 70 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 71 | - { |
|
| 66 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 72 | 67 | $output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line) |
| 73 | 68 | 'MyAdmin DocBlock Parser', |
| 74 | 69 | '=======================', |
@@ -106,8 +101,7 @@ discard block |
||
| 106 | 101 | * @param $calls |
| 107 | 102 | * @return array |
| 108 | 103 | */ |
| 109 | - function do_call($parent, $call, $calls) |
|
| 110 | - { |
|
| 104 | + function do_call($parent, $call, $calls) { |
|
| 111 | 105 | echo "Running \$parent->$call();".PHP_EOL; |
| 112 | 106 | $response = $parent->$call(); |
| 113 | 107 | if (isset($calls[$call])) { |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function execute(InputInterface $input, OutputInterface $output) |
| 67 | 67 | { |
| 68 | - $output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line) |
|
| 68 | + $output->writeln([// outputs multiple lines to the console (adding "\n" at the end of each line) |
|
| 69 | 69 | 'User Creator', |
| 70 | 70 | '============', |
| 71 | 71 | '' |
@@ -18,10 +18,8 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @package MyAdmin\Plugins\Command |
| 20 | 20 | */ |
| 21 | -class Command extends BaseCommand |
|
| 22 | -{ |
|
| 23 | - protected function configure() |
|
| 24 | - { |
|
| 21 | +class Command extends BaseCommand { |
|
| 22 | + protected function configure() { |
|
| 25 | 23 | $this |
| 26 | 24 | // the name of the command (the part after "bin/console") |
| 27 | 25 | ->setName('myadmin') |
@@ -39,8 +37,7 @@ discard block |
||
| 39 | 37 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 40 | 38 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 41 | 39 | */ |
| 42 | - protected function initialize(InputInterface $input, OutputInterface $output) |
|
| 43 | - { |
|
| 40 | + protected function initialize(InputInterface $input, OutputInterface $output) { |
|
| 44 | 41 | } |
| 45 | 42 | |
| 46 | 43 | /** (optional) |
@@ -52,8 +49,7 @@ discard block |
||
| 52 | 49 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 53 | 50 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 54 | 51 | */ |
| 55 | - protected function interact(InputInterface $input, OutputInterface $output) |
|
| 56 | - { |
|
| 52 | + protected function interact(InputInterface $input, OutputInterface $output) { |
|
| 57 | 53 | } |
| 58 | 54 | |
| 59 | 55 | /** (required) |
@@ -63,8 +59,7 @@ discard block |
||
| 63 | 59 | * @param InputInterface $input |
| 64 | 60 | * @param OutputInterface $output |
| 65 | 61 | */ |
| 66 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 67 | - { |
|
| 62 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 68 | 63 | $output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line) |
| 69 | 64 | 'User Creator', |
| 70 | 65 | '============', |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | */ |
| 75 | 75 | protected function execute(InputInterface $input, OutputInterface $output) |
| 76 | 76 | { |
| 77 | - $output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line) |
|
| 77 | + $output->writeln([// outputs multiple lines to the console (adding "\n" at the end of each line) |
|
| 78 | 78 | 'User Creator', |
| 79 | 79 | '============', |
| 80 | 80 | '' |
@@ -21,10 +21,8 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @package MyAdmin\Plugins\Command |
| 23 | 23 | */ |
| 24 | -class CreateUser extends BaseCommand |
|
| 25 | -{ |
|
| 26 | - protected function configure() |
|
| 27 | - { |
|
| 24 | +class CreateUser extends BaseCommand { |
|
| 25 | + protected function configure() { |
|
| 28 | 26 | $this |
| 29 | 27 | ->setName('myadmin:create-user') // the name of the command (the part after "bin/console") |
| 30 | 28 | ->setDescription('Creates a new user.') // the short description shown while running "php bin/console list" |
@@ -48,8 +46,7 @@ discard block |
||
| 48 | 46 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 49 | 47 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 50 | 48 | */ |
| 51 | - protected function initialize(InputInterface $input, OutputInterface $output) |
|
| 52 | - { |
|
| 49 | + protected function initialize(InputInterface $input, OutputInterface $output) { |
|
| 53 | 50 | } |
| 54 | 51 | |
| 55 | 52 | /** (optional) |
@@ -61,8 +58,7 @@ discard block |
||
| 61 | 58 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 62 | 59 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 63 | 60 | */ |
| 64 | - protected function interact(InputInterface $input, OutputInterface $output) |
|
| 65 | - { |
|
| 61 | + protected function interact(InputInterface $input, OutputInterface $output) { |
|
| 66 | 62 | } |
| 67 | 63 | |
| 68 | 64 | /** (required) |
@@ -72,8 +68,7 @@ discard block |
||
| 72 | 68 | * @param InputInterface $input |
| 73 | 69 | * @param OutputInterface $output |
| 74 | 70 | */ |
| 75 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 76 | - { |
|
| 71 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 77 | 72 | $output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line) |
| 78 | 73 | 'User Creator', |
| 79 | 74 | '============', |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | protected function execute(InputInterface $input, OutputInterface $output) |
| 64 | 64 | { |
| 65 | - $output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line) |
|
| 65 | + $output->writeln([// outputs multiple lines to the console (adding "\n" at the end of each line) |
|
| 66 | 66 | 'User Creator', |
| 67 | 67 | '============', |
| 68 | 68 | '' |
@@ -18,10 +18,8 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @package MyAdmin\Plugins\Command |
| 20 | 20 | */ |
| 21 | -class UpdatePlugins extends BaseCommand |
|
| 22 | -{ |
|
| 23 | - protected function configure() |
|
| 24 | - { |
|
| 21 | +class UpdatePlugins extends BaseCommand { |
|
| 22 | + protected function configure() { |
|
| 25 | 23 | $this |
| 26 | 24 | ->setName('myadmin:update-plugins') // the name of the command (the part after "bin/console") |
| 27 | 25 | ->setDescription('Finds and Caches Plugins into MyAdmin') // the short description shown while running "php bin/console list" |
@@ -35,8 +33,7 @@ discard block |
||
| 35 | 33 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 36 | 34 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 37 | 35 | */ |
| 38 | - protected function initialize(InputInterface $input, OutputInterface $output) |
|
| 39 | - { |
|
| 36 | + protected function initialize(InputInterface $input, OutputInterface $output) { |
|
| 40 | 37 | } |
| 41 | 38 | |
| 42 | 39 | /** (optional) |
@@ -48,8 +45,7 @@ discard block |
||
| 48 | 45 | * @param \Symfony\Component\Console\Input\InputInterface $input |
| 49 | 46 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
| 50 | 47 | */ |
| 51 | - protected function interact(InputInterface $input, OutputInterface $output) |
|
| 52 | - { |
|
| 48 | + protected function interact(InputInterface $input, OutputInterface $output) { |
|
| 53 | 49 | } |
| 54 | 50 | |
| 55 | 51 | |
@@ -60,8 +56,7 @@ discard block |
||
| 60 | 56 | * @param InputInterface $input |
| 61 | 57 | * @param OutputInterface $output |
| 62 | 58 | */ |
| 63 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 64 | - { |
|
| 59 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 65 | 60 | $output->writeln([ // outputs multiple lines to the console (adding "\n" at the end of each line) |
| 66 | 61 | 'User Creator', |
| 67 | 62 | '============', |