| Conditions | 12 |
| Paths | 2048 |
| Total Lines | 81 |
| Code Lines | 57 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php namespace crocodicstudio\crudbooster\commands; |
||
| 117 | private function checkRequirements() |
||
| 118 | { |
||
| 119 | $this->info('System Requirements Checking:'); |
||
| 120 | $system_failed = 0; |
||
| 121 | $laravel = app(); |
||
| 122 | |||
| 123 | if ($laravel::VERSION >= 5.6) { |
||
| 124 | $this->info('Laravel Version (>= 5.6): [Good]'); |
||
| 125 | } else { |
||
| 126 | $this->warn('Laravel Version (>= 5.6): [Bad]'); |
||
| 127 | $system_failed++; |
||
| 128 | } |
||
| 129 | |||
| 130 | if (version_compare(phpversion(), '7.1.3', '>=')) { |
||
| 131 | $this->info('PHP Version (>= 7.*): [Good]'); |
||
| 132 | } else { |
||
| 133 | $this->warn('PHP Version (>= 7.*): [Bad] Yours: '.phpversion()); |
||
| 134 | $system_failed++; |
||
| 135 | } |
||
| 136 | |||
| 137 | if (extension_loaded('mbstring')) { |
||
| 138 | $this->info('Mbstring extension: [Good]'); |
||
| 139 | } else { |
||
| 140 | $this->warn('Mbstring extension: [Bad]'); |
||
| 141 | $system_failed++; |
||
| 142 | } |
||
| 143 | |||
| 144 | if (extension_loaded('openssl')) { |
||
| 145 | $this->info('OpenSSL extension: [Good]'); |
||
| 146 | } else { |
||
| 147 | $this->warn('OpenSSL extension: [Bad]'); |
||
| 148 | $system_failed++; |
||
| 149 | } |
||
| 150 | |||
| 151 | if (extension_loaded('pdo')) { |
||
| 152 | $this->info('PDO extension: [Good]'); |
||
| 153 | } else { |
||
| 154 | $this->warn('PDO extension: [Bad]'); |
||
| 155 | $system_failed++; |
||
| 156 | } |
||
| 157 | |||
| 158 | if (extension_loaded('tokenizer')) { |
||
| 159 | $this->info('Tokenizer extension: [Good]'); |
||
| 160 | } else { |
||
| 161 | $this->warn('Tokenizer extension: [Bad]'); |
||
| 162 | $system_failed++; |
||
| 163 | } |
||
| 164 | |||
| 165 | if (extension_loaded('xml')) { |
||
| 166 | $this->info('XML extension: [Good]'); |
||
| 167 | } else { |
||
| 168 | $this->warn('XML extension: [Bad]'); |
||
| 169 | $system_failed++; |
||
| 170 | } |
||
| 171 | |||
| 172 | if (extension_loaded('gd')) { |
||
| 173 | $this->info('GD extension: [Good]'); |
||
| 174 | } else { |
||
| 175 | $this->warn('GD extension: [Bad]'); |
||
| 176 | $system_failed++; |
||
| 177 | } |
||
| 178 | |||
| 179 | if (extension_loaded('fileinfo')) { |
||
| 180 | $this->info('PHP Fileinfo extension: [Good]'); |
||
| 181 | } else { |
||
| 182 | $this->warn('PHP Fileinfo extension: [Bad]'); |
||
| 183 | $system_failed++; |
||
| 184 | } |
||
| 185 | |||
| 186 | if (is_writable(base_path('public'))) { |
||
| 187 | $this->info('public dir is writable: [Good]'); |
||
| 188 | } else { |
||
| 189 | $this->warn('public dir is writable: [Bad]'); |
||
| 190 | $system_failed++; |
||
| 191 | } |
||
| 192 | |||
| 193 | if ($system_failed != 0) { |
||
| 194 | $this->warn('Sorry unfortunately your system is not meet with our requirements !'); |
||
| 195 | $this->footer(false); |
||
| 196 | } |
||
| 197 | $this->info('--'); |
||
| 198 | } |
||
| 233 |