Completed
Branch master (01bfb0)
by Nik
03:53
created
src/Module/Exception/ModuleUninstallException.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * For the full copyright and license information, please view the LICENSE.md
4
- * file that was distributed with this source code.
5
- */
3
+     * For the full copyright and license information, please view the LICENSE.md
4
+     * file that was distributed with this source code.
5
+     */
6 6
 
7 7
 namespace Notamedia\ConsoleJedi\Module\Exception;
8 8
 
Please login to merge, or discard this patch.
src/Module/Command/UpdateCommand.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -18,38 +18,38 @@
 block discarded – undo
18 18
  */
19 19
 class UpdateCommand extends ModuleCommand
20 20
 {
21
-	use CanRestart;
21
+    use CanRestart;
22 22
 
23
-	/**
24
-	 * {@inheritdoc}
25
-	 */
26
-	protected function configure()
27
-	{
28
-		parent::configure();
23
+    /**
24
+     * {@inheritdoc}
25
+     */
26
+    protected function configure()
27
+    {
28
+        parent::configure();
29 29
 
30
-		$this->setName('module:update')
31
-			->setDescription('Load module updates from Marketplace')
32
-			->addOption('beta', 'b', InputOption::VALUE_NONE, 'Allow the installation of beta releases');
33
-	}
30
+        $this->setName('module:update')
31
+            ->setDescription('Load module updates from Marketplace')
32
+            ->addOption('beta', 'b', InputOption::VALUE_NONE, 'Allow the installation of beta releases');
33
+    }
34 34
 
35
-	/**
36
-	 * {@inheritdoc}
37
-	 */
38
-	protected function execute(InputInterface $input, OutputInterface $output)
39
-	{
40
-		$module = new Module($input->getArgument('module'));
41
-		$modulesUpdated = null;
42
-		while ($module->update($modulesUpdated))
43
-		{
44
-			if (is_array($modulesUpdated))
45
-			{
46
-				foreach ($modulesUpdated as $moduleName => $moduleVersion)
47
-				{
48
-					$output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion));
49
-				}
50
-			}
51
-			return $this->restartScript($input, $output);
52
-		}
53
-		return 0;
54
-	}
35
+    /**
36
+     * {@inheritdoc}
37
+     */
38
+    protected function execute(InputInterface $input, OutputInterface $output)
39
+    {
40
+        $module = new Module($input->getArgument('module'));
41
+        $modulesUpdated = null;
42
+        while ($module->update($modulesUpdated))
43
+        {
44
+            if (is_array($modulesUpdated))
45
+            {
46
+                foreach ($modulesUpdated as $moduleName => $moduleVersion)
47
+                {
48
+                    $output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion));
49
+                }
50
+            }
51
+            return $this->restartScript($input, $output);
52
+        }
53
+        return 0;
54
+    }
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
src/Module/Command/ModuleCommand.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * For the full copyright and license information, please view the LICENSE.md
4
- * file that was distributed with this source code.
5
- */
3
+     * For the full copyright and license information, please view the LICENSE.md
4
+     * file that was distributed with this source code.
5
+     */
6 6
 
7 7
 namespace Notamedia\ConsoleJedi\Module\Command;
8 8
 
@@ -21,48 +21,48 @@  discard block
 block discarded – undo
21 21
  */
22 22
 abstract class ModuleCommand extends BitrixCommand
23 23
 {
24
-	/**
25
-	 * {@inheritdoc}
26
-	 */
27
-	protected function configure()
28
-	{
29
-		parent::configure();
24
+    /**
25
+     * {@inheritdoc}
26
+     */
27
+    protected function configure()
28
+    {
29
+        parent::configure();
30 30
 
31
-		$this->addArgument('module', InputArgument::REQUIRED, 'Module name (e.g. `vendor.module`)')
32
-			->addOption('confirm-thirdparty', 'ct', InputOption::VALUE_NONE, 'Suppress third-party modules warning');
33
-	}
31
+        $this->addArgument('module', InputArgument::REQUIRED, 'Module name (e.g. `vendor.module`)')
32
+            ->addOption('confirm-thirdparty', 'ct', InputOption::VALUE_NONE, 'Suppress third-party modules warning');
33
+    }
34 34
 
35
-	/**
36
-	 * @inheritdoc
37
-	 */
38
-	protected function interact(InputInterface $input, OutputInterface $output)
39
-	{
40
-		parent::interact($input, $output);
35
+    /**
36
+     * @inheritdoc
37
+     */
38
+    protected function interact(InputInterface $input, OutputInterface $output)
39
+    {
40
+        parent::interact($input, $output);
41 41
 
42
-		$module = new Module($input->getArgument('module'));
42
+        $module = new Module($input->getArgument('module'));
43 43
 
44
-		if (in_array($this->getName(), ['module:register', 'module:unregister'])
45
-			&& $module->isThirdParty() && !$input->getOption('confirm-thirdparty')
46
-		)
47
-		{
48
-			$output->writeln($module->isThirdParty() . ' is not a kernel module. Correct operation cannot be guaranteed for third-party modules!');
49
-		}
50
-	}
44
+        if (in_array($this->getName(), ['module:register', 'module:unregister'])
45
+            && $module->isThirdParty() && !$input->getOption('confirm-thirdparty')
46
+        )
47
+        {
48
+            $output->writeln($module->isThirdParty() . ' is not a kernel module. Correct operation cannot be guaranteed for third-party modules!');
49
+        }
50
+    }
51 51
 
52
-	/**
53
-	 * Gets console commands from this package.
54
-	 *
55
-	 * @return Command[]
56
-	 */
57
-	public static function getCommands()
58
-	{
59
-		return [
60
-			new LoadCommand(),
61
-			new RegisterCommand(),
62
-			new RemoveCommand(),
63
-			new UnregisterCommand(),
64
-			new UpdateCommand(),
65
-		];
66
-	}
52
+    /**
53
+     * Gets console commands from this package.
54
+     *
55
+     * @return Command[]
56
+     */
57
+    public static function getCommands()
58
+    {
59
+        return [
60
+            new LoadCommand(),
61
+            new RegisterCommand(),
62
+            new RemoveCommand(),
63
+            new UnregisterCommand(),
64
+            new UpdateCommand(),
65
+        ];
66
+    }
67 67
 
68 68
 }
69 69
\ No newline at end of file
Please login to merge, or discard this patch.
src/Module/Command/RegisterCommand.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -17,24 +17,24 @@
 block discarded – undo
17 17
  */
18 18
 class RegisterCommand extends ModuleCommand
19 19
 {
20
-	/**
21
-	 * {@inheritdoc}
22
-	 */
23
-	protected function configure()
24
-	{
25
-		parent::configure();
20
+    /**
21
+     * {@inheritdoc}
22
+     */
23
+    protected function configure()
24
+    {
25
+        parent::configure();
26 26
 
27
-		$this->setName('module:register')
28
-			->setDescription('Install module');
29
-	}
27
+        $this->setName('module:register')
28
+            ->setDescription('Install module');
29
+    }
30 30
 
31
-	/**
32
-	 * {@inheritdoc}
33
-	 */
34
-	protected function execute(InputInterface $input, OutputInterface $output)
35
-	{
36
-		$module = new Module($input->getArgument('module'));
37
-		$module->register();
38
-		$output->writeln(sprintf('registered <info>%s</info>', $module->getName()));
39
-	}
31
+    /**
32
+     * {@inheritdoc}
33
+     */
34
+    protected function execute(InputInterface $input, OutputInterface $output)
35
+    {
36
+        $module = new Module($input->getArgument('module'));
37
+        $module->register();
38
+        $output->writeln(sprintf('registered <info>%s</info>', $module->getName()));
39
+    }
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
src/Module/Command/LoadCommand.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -19,72 +19,72 @@
 block discarded – undo
19 19
  */
20 20
 class LoadCommand extends ModuleCommand
21 21
 {
22
-	use CanRestart;
22
+    use CanRestart;
23 23
 
24
-	/**
25
-	 * {@inheritdoc}
26
-	 */
27
-	protected function configure()
28
-	{
29
-		parent::configure();
24
+    /**
25
+     * {@inheritdoc}
26
+     */
27
+    protected function configure()
28
+    {
29
+        parent::configure();
30 30
 
31
-		$this->setName('module:load')
32
-			->setDescription('Load and install module from Marketplace')
33
-			->addOption('no-update', 'nu', InputOption::VALUE_NONE, 'Don\' update module')
34
-			->addOption('no-register', 'ni', InputOption::VALUE_NONE, 'Load only, don\' register module')
35
-			->addOption('beta', 'b', InputOption::VALUE_NONE, 'Allow the installation of beta releases');
36
-	}
31
+        $this->setName('module:load')
32
+            ->setDescription('Load and install module from Marketplace')
33
+            ->addOption('no-update', 'nu', InputOption::VALUE_NONE, 'Don\' update module')
34
+            ->addOption('no-register', 'ni', InputOption::VALUE_NONE, 'Load only, don\' register module')
35
+            ->addOption('beta', 'b', InputOption::VALUE_NONE, 'Allow the installation of beta releases');
36
+    }
37 37
 
38
-	/**
39
-	 * {@inheritdoc}
40
-	 */
41
-	protected function execute(InputInterface $input, OutputInterface $output)
42
-	{
43
-		$module = new Module($input->getArgument('module'));
38
+    /**
39
+     * {@inheritdoc}
40
+     */
41
+    protected function execute(InputInterface $input, OutputInterface $output)
42
+    {
43
+        $module = new Module($input->getArgument('module'));
44 44
 
45
-		if (!$module->isThirdParty())
46
-		{
47
-			$output->writeln('<info>Loading kernel modules is unsupported</info>');
48
-		}
45
+        if (!$module->isThirdParty())
46
+        {
47
+            $output->writeln('<info>Loading kernel modules is unsupported</info>');
48
+        }
49 49
 
50
-		if ($input->getOption('beta'))
51
-		{
52
-			$module->setBeta();
53
-		}
50
+        if ($input->getOption('beta'))
51
+        {
52
+            $module->setBeta();
53
+        }
54 54
 
55
-		$module->load();
55
+        $module->load();
56 56
 
57
-		if (!$input->getOption('no-update'))
58
-		{
59
-			$modulesUpdated = null;
60
-			while ($module->update($modulesUpdated))
61
-			{
62
-				if (is_array($modulesUpdated))
63
-				{
64
-					foreach ($modulesUpdated as $moduleName => $moduleVersion)
65
-					{
66
-						$output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion));
67
-					}
68
-				}
69
-				return $this->restartScript($input, $output);
70
-			}
71
-		}
57
+        if (!$input->getOption('no-update'))
58
+        {
59
+            $modulesUpdated = null;
60
+            while ($module->update($modulesUpdated))
61
+            {
62
+                if (is_array($modulesUpdated))
63
+                {
64
+                    foreach ($modulesUpdated as $moduleName => $moduleVersion)
65
+                    {
66
+                        $output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion));
67
+                    }
68
+                }
69
+                return $this->restartScript($input, $output);
70
+            }
71
+        }
72 72
 
73
-		if (!$input->getOption('no-register'))
74
-		{
75
-			try
76
-			{
77
-				$module->register();
78
-			}
79
-			catch (ModuleInstallException $e)
80
-			{
81
-				$output->writeln(sprintf('<comment>%s</comment>', $e->getMessage()), OutputInterface::VERBOSITY_VERBOSE);
82
-				$output->writeln(sprintf('Module loaded, but <error>not registered</error>. You need to do it yourself in admin panel.', $module->getName()));
83
-			}
84
-		}
73
+        if (!$input->getOption('no-register'))
74
+        {
75
+            try
76
+            {
77
+                $module->register();
78
+            }
79
+            catch (ModuleInstallException $e)
80
+            {
81
+                $output->writeln(sprintf('<comment>%s</comment>', $e->getMessage()), OutputInterface::VERBOSITY_VERBOSE);
82
+                $output->writeln(sprintf('Module loaded, but <error>not registered</error>. You need to do it yourself in admin panel.', $module->getName()));
83
+            }
84
+        }
85 85
 
86
-		$output->writeln(sprintf('installed <info>%s</info>', $module->getName()));
86
+        $output->writeln(sprintf('installed <info>%s</info>', $module->getName()));
87 87
 
88
-		return 0;
89
-	}
88
+        return 0;
89
+    }
90 90
 }
91 91
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,7 @@
 block discarded – undo
75 75
 			try
76 76
 			{
77 77
 				$module->register();
78
-			}
79
-			catch (ModuleInstallException $e)
78
+			} catch (ModuleInstallException $e)
80 79
 			{
81 80
 				$output->writeln(sprintf('<comment>%s</comment>', $e->getMessage()), OutputInterface::VERBOSITY_VERBOSE);
82 81
 				$output->writeln(sprintf('Module loaded, but <error>not registered</error>. You need to do it yourself in admin panel.', $module->getName()));
Please login to merge, or discard this patch.
src/Module/Command/UnregisterCommand.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * For the full copyright and license information, please view the LICENSE.md
4
- * file that was distributed with this source code.
5
- */
3
+     * For the full copyright and license information, please view the LICENSE.md
4
+     * file that was distributed with this source code.
5
+     */
6 6
 
7 7
 namespace Notamedia\ConsoleJedi\Module\Command;
8 8
 
@@ -17,24 +17,24 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class UnregisterCommand extends ModuleCommand
19 19
 {
20
-	/**
21
-	 * {@inheritdoc}
22
-	 */
23
-	protected function configure()
24
-	{
25
-		parent::configure();
20
+    /**
21
+     * {@inheritdoc}
22
+     */
23
+    protected function configure()
24
+    {
25
+        parent::configure();
26 26
 
27
-		$this->setName('module:unregister')
28
-			->setDescription('Uninstall module');
29
-	}
27
+        $this->setName('module:unregister')
28
+            ->setDescription('Uninstall module');
29
+    }
30 30
 
31
-	/**
32
-	 * {@inheritdoc}
33
-	 */
34
-	protected function execute(InputInterface $input, OutputInterface $output)
35
-	{
36
-		$module = new Module($input->getArgument('module'));
37
-		$module->unRegister();
38
-		$output->writeln(sprintf('unregistered <info>%s</info>', $module->getName()));
39
-	}
31
+    /**
32
+     * {@inheritdoc}
33
+     */
34
+    protected function execute(InputInterface $input, OutputInterface $output)
35
+    {
36
+        $module = new Module($input->getArgument('module'));
37
+        $module->unRegister();
38
+        $output->writeln(sprintf('unregistered <info>%s</info>', $module->getName()));
39
+    }
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
src/Module/Command/RemoveCommand.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * For the full copyright and license information, please view the LICENSE.md
4
- * file that was distributed with this source code.
5
- */
3
+     * For the full copyright and license information, please view the LICENSE.md
4
+     * file that was distributed with this source code.
5
+     */
6 6
 
7 7
 namespace Notamedia\ConsoleJedi\Module\Command;
8 8
 
@@ -17,24 +17,24 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class RemoveCommand extends ModuleCommand
19 19
 {
20
-	/**
21
-	 * {@inheritdoc}
22
-	 */
23
-	protected function configure()
24
-	{
25
-		parent::configure();
20
+    /**
21
+     * {@inheritdoc}
22
+     */
23
+    protected function configure()
24
+    {
25
+        parent::configure();
26 26
 
27
-		$this->setName('module:remove')
28
-			->setDescription('Uninstall and remove module folder from system');
29
-	}
27
+        $this->setName('module:remove')
28
+            ->setDescription('Uninstall and remove module folder from system');
29
+    }
30 30
 
31
-	/**
32
-	 * {@inheritdoc}
33
-	 */
34
-	protected function execute(InputInterface $input, OutputInterface $output)
35
-	{
36
-		$module = new Module($input->getArgument('module'));
37
-		$module->remove();
38
-		$output->writeln(sprintf('removed <info>%s</info>', $module->getName()));
39
-	}
31
+    /**
32
+     * {@inheritdoc}
33
+     */
34
+    protected function execute(InputInterface $input, OutputInterface $output)
35
+    {
36
+        $module = new Module($input->getArgument('module'));
37
+        $module->remove();
38
+        $output->writeln(sprintf('removed <info>%s</info>', $module->getName()));
39
+    }
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
src/Cache/Command/ClearCommand.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * For the full copyright and license information, please view the LICENSE.md
4
- * file that was distributed with this source code.
5
- */
3
+     * For the full copyright and license information, please view the LICENSE.md
4
+     * file that was distributed with this source code.
5
+     */
6 6
 
7 7
 namespace Notamedia\ConsoleJedi\Cache\Command;
8 8
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
             if (Cache::clearCache(true))
52 52
             {
53 53
                 $output->writeln('<info>All Bitrix cache was deleted</info>');
54
-            }
55
-            else
54
+            } else
56 55
             {
57 56
                 $output->writeln('<error>Error deleting Bitrix cache</error>');
58 57
             }
Please login to merge, or discard this patch.
src/Agent/AgentTrait.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * For the full copyright and license information, please view the LICENSE.md
4
- * file that was distributed with this source code.
5
- */
3
+     * For the full copyright and license information, please view the LICENSE.md
4
+     * file that was distributed with this source code.
5
+     */
6 6
 
7 7
 namespace Notamedia\ConsoleJedi\Agent;
8 8
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,7 @@
 block discarded – undo
108 108
             {
109 109
                 // @todo warning
110 110
             }
111
-        }
112
-        else
111
+        } else
113 112
         {
114 113
             // @todo warning
115 114
         }
Please login to merge, or discard this patch.