@@ -54,7 +54,7 @@ |
||
54 | 54 | { |
55 | 55 | $this->isCaseSensitive = $caseSensitive; |
56 | 56 | $this->hint = 'Commit message should not contain blacklisted words'; |
57 | - $this->stringDetection = function (string $content, string $term): bool { |
|
57 | + $this->stringDetection = function(string $content, string $term): bool { |
|
58 | 58 | return strpos($content, $term) !== false; |
59 | 59 | }; |
60 | 60 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | ksort($relevantContent); |
114 | 114 | |
115 | - return md5((string)json_encode($relevantContent)); |
|
115 | + return md5((string) json_encode($relevantContent)); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -127,6 +127,6 @@ discard block |
||
127 | 127 | if (!file_exists($file)) { |
128 | 128 | throw new Exception($file . ' not found'); |
129 | 129 | } |
130 | - return (string)file_get_contents($file); |
|
130 | + return (string) file_get_contents($file); |
|
131 | 131 | } |
132 | 132 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | */ |
91 | 91 | public function getArgument(string $name, string $default = ''): string |
92 | 92 | { |
93 | - return (string)($this->getArguments()[$name] ?? $default); |
|
93 | + return (string) ($this->getArguments()[$name] ?? $default); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | { |
37 | 37 | parent::configure(); |
38 | 38 | $this->setName('add') |
39 | - ->setDescription('Add an action to a hook configuration') |
|
40 | - ->setHelp('This command will add an action configuration to a given hook configuration') |
|
41 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to add the action to'); |
|
39 | + ->setDescription('Add an action to a hook configuration') |
|
40 | + ->setHelp('This command will add an action configuration to a given hook configuration') |
|
41 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to add the action to'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | |
58 | 58 | $editor = new Editor($io, $config); |
59 | 59 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
60 | - ->setChange('AddAction') |
|
61 | - ->run(); |
|
60 | + ->setChange('AddAction') |
|
61 | + ->run(); |
|
62 | 62 | |
63 | 63 | return 0; |
64 | 64 | } |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | { |
37 | 37 | parent::configure(); |
38 | 38 | $this->setName('disable') |
39 | - ->setDescription('Disable a hook execution') |
|
40 | - ->setHelp('This command will disable a hook configuration for a given hook') |
|
41 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to disable'); |
|
39 | + ->setDescription('Disable a hook execution') |
|
40 | + ->setHelp('This command will disable a hook configuration for a given hook') |
|
41 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to disable'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | |
58 | 58 | $editor = new Editor($io, $config); |
59 | 59 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
60 | - ->setChange('DisableHook') |
|
61 | - ->run(); |
|
60 | + ->setChange('DisableHook') |
|
61 | + ->run(); |
|
62 | 62 | |
63 | 63 | return 0; |
64 | 64 | } |
@@ -46,8 +46,8 @@ |
||
46 | 46 | { |
47 | 47 | parent::configure(); |
48 | 48 | $this->setName('hook:' . $this->hookName) |
49 | - ->setDescription('Run git ' . $this->hookName . ' hook.') |
|
50 | - ->setHelp('This command executes the ' . $this->hookName . ' hook.'); |
|
49 | + ->setDescription('Run git ' . $this->hookName . ' hook.') |
|
50 | + ->setHelp('This command executes the ' . $this->hookName . ' hook.'); |
|
51 | 51 | |
52 | 52 | $this->addOption( |
53 | 53 | 'bootstrap', |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | { |
37 | 37 | parent::configure(); |
38 | 38 | $this->setName('configure') |
39 | - ->setDescription('Configure your hooks') |
|
40 | - ->setHelp('This command creates or updates your captainhook configuration') |
|
41 | - ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
42 | - ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
43 | - ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
44 | - ->addOption( |
|
45 | - 'bootstrap', |
|
46 | - null, |
|
47 | - InputOption::VALUE_OPTIONAL, |
|
48 | - 'Path to composers vendor/autoload.php' |
|
49 | - ); |
|
39 | + ->setDescription('Configure your hooks') |
|
40 | + ->setHelp('This command creates or updates your captainhook configuration') |
|
41 | + ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
42 | + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
43 | + ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
44 | + ->addOption( |
|
45 | + 'bootstrap', |
|
46 | + null, |
|
47 | + InputOption::VALUE_OPTIONAL, |
|
48 | + 'Path to composers vendor/autoload.php' |
|
49 | + ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | |
65 | 65 | $configurator = new Creator($io, $config); |
66 | 66 | $configurator->force(IOUtil::argToBool($input->getOption('force'))) |
67 | - ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
68 | - ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
69 | - ->run(); |
|
67 | + ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
68 | + ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
69 | + ->run(); |
|
70 | 70 | return 0; |
71 | 71 | } |
72 | 72 | } |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | { |
37 | 37 | parent::configure(); |
38 | 38 | $this->setName('enable') |
39 | - ->setDescription('Enable a hook execution') |
|
40 | - ->setHelp('This command will enable a hook configuration for a given hook') |
|
41 | - ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to enable'); |
|
39 | + ->setDescription('Enable a hook execution') |
|
40 | + ->setHelp('This command will enable a hook configuration for a given hook') |
|
41 | + ->addArgument('hook', InputArgument::REQUIRED, 'Hook you want to enable'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | |
58 | 58 | $editor = new Editor($io, $config); |
59 | 59 | $editor->setHook(IOUtil::argToString($input->getArgument('hook'))) |
60 | - ->setChange('EnableHook') |
|
61 | - ->run(); |
|
60 | + ->setChange('EnableHook') |
|
61 | + ->run(); |
|
62 | 62 | |
63 | 63 | return 0; |
64 | 64 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | ob_start(); |
80 | 80 | $class::$method(); |
81 | - return (string)ob_get_clean(); |
|
81 | + return (string) ob_get_clean(); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -107,6 +107,6 @@ discard block |
||
107 | 107 | */ |
108 | 108 | protected function isStaticMethodCall(string $class): bool |
109 | 109 | { |
110 | - return (bool)preg_match('#^\\\\.+::.+$#i', $class); |
|
110 | + return (bool) preg_match('#^\\\\.+::.+$#i', $class); |
|
111 | 111 | } |
112 | 112 | } |