Conditions | 12 |
Paths | 2048 |
Total Lines | 81 |
Code Lines | 57 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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; |
||
118 | private function checkRequirements() |
||
119 | { |
||
120 | $this->info('System Requirements Checking:'); |
||
121 | $system_failed = 0; |
||
122 | $laravel = app(); |
||
123 | |||
124 | if ($laravel::VERSION >= 5.7) { |
||
|
|||
125 | $this->info('Laravel Version (>= 5.7): [Good]'); |
||
126 | } else { |
||
127 | $this->warn('Laravel Version (>= 5.7): [Bad]'); |
||
128 | $system_failed++; |
||
129 | } |
||
130 | |||
131 | if (version_compare(phpversion(), '7.2.0', '>=')) { |
||
132 | $this->info('PHP Version (>= 7.2.0): [Good]'); |
||
133 | } else { |
||
134 | $this->warn('PHP Version (>= 7.2.0): [Bad] Yours: '.phpversion()); |
||
135 | $system_failed++; |
||
136 | } |
||
137 | |||
138 | if (extension_loaded('mbstring')) { |
||
139 | $this->info('Mbstring extension: [Good]'); |
||
140 | } else { |
||
141 | $this->warn('Mbstring extension: [Bad]'); |
||
142 | $system_failed++; |
||
143 | } |
||
144 | |||
145 | if (extension_loaded('openssl')) { |
||
146 | $this->info('OpenSSL extension: [Good]'); |
||
147 | } else { |
||
148 | $this->warn('OpenSSL extension: [Bad]'); |
||
149 | $system_failed++; |
||
150 | } |
||
151 | |||
152 | if (extension_loaded('pdo')) { |
||
153 | $this->info('PDO extension: [Good]'); |
||
154 | } else { |
||
155 | $this->warn('PDO extension: [Bad]'); |
||
156 | $system_failed++; |
||
157 | } |
||
158 | |||
159 | if (extension_loaded('tokenizer')) { |
||
160 | $this->info('Tokenizer extension: [Good]'); |
||
161 | } else { |
||
162 | $this->warn('Tokenizer extension: [Bad]'); |
||
163 | $system_failed++; |
||
164 | } |
||
165 | |||
166 | if (extension_loaded('xml')) { |
||
167 | $this->info('XML extension: [Good]'); |
||
168 | } else { |
||
169 | $this->warn('XML extension: [Bad]'); |
||
170 | $system_failed++; |
||
171 | } |
||
172 | |||
173 | if (extension_loaded('gd')) { |
||
174 | $this->info('GD extension: [Good]'); |
||
175 | } else { |
||
176 | $this->warn('GD extension: [Bad]'); |
||
177 | $system_failed++; |
||
178 | } |
||
179 | |||
180 | if (extension_loaded('fileinfo')) { |
||
181 | $this->info('PHP Fileinfo extension: [Good]'); |
||
182 | } else { |
||
183 | $this->warn('PHP Fileinfo extension: [Bad]'); |
||
184 | $system_failed++; |
||
185 | } |
||
186 | |||
187 | if (is_writable(base_path('public'))) { |
||
188 | $this->info('public dir is writable: [Good]'); |
||
189 | } else { |
||
190 | $this->warn('public dir is writable: [Bad]'); |
||
191 | $system_failed++; |
||
192 | } |
||
193 | |||
194 | if ($system_failed != 0) { |
||
195 | $this->warn('Sorry unfortunately your system is not meet with our requirements !'); |
||
196 | $this->footer(false); |
||
197 | } |
||
198 | $this->info('--'); |
||
199 | } |
||
221 |