We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 1 |
| Paths | 1 |
| Total Lines | 71 |
| Code Lines | 59 |
| 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 |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | \Schema::create('plugins', function (Blueprint $table) { |
||
| 17 | $table->increments('id'); |
||
| 18 | $table->string('name'); |
||
| 19 | $table->string('version'); |
||
| 20 | $table->string('icon'); |
||
| 21 | $table->tinyInteger('enabled')->nullable(); |
||
| 22 | $table->tinyInteger('installed')->nullable(); |
||
| 23 | $table->tinyInteger('hidden')->nullable(); |
||
| 24 | $table->tinyInteger('required')->nullable(); |
||
| 25 | $table->tinyInteger('is_frontend')->nullable(); |
||
| 26 | $table->tinyInteger('is_backend')->nullable(); |
||
| 27 | $table->timestamps(); |
||
| 28 | }); |
||
| 29 | |||
| 30 | /* |
||
| 31 | * DATA REQUIRED FOR APPLICATION CORE LOADING. |
||
| 32 | */ |
||
| 33 | $plugin = new Plugin; |
||
| 34 | $plugin->setName('products'); |
||
| 35 | $plugin->setVersion('1.0'); |
||
| 36 | $plugin->setIcon('fa-book'); |
||
| 37 | $plugin->setEnabled(true); |
||
| 38 | $plugin->setRequired(true); |
||
| 39 | $plugin->setFrontEnd(false); |
||
| 40 | $plugin->setBackEnd(true); |
||
| 41 | $plugin->save(); |
||
| 42 | |||
| 43 | $plugin = new Plugin; |
||
| 44 | $plugin->setName('menus'); |
||
| 45 | $plugin->setVersion('1.0'); |
||
| 46 | $plugin->setIcon('fa-bars'); |
||
| 47 | $plugin->setEnabled(true); |
||
| 48 | $plugin->setFrontEnd(false); |
||
| 49 | $plugin->setBackEnd(true); |
||
| 50 | $plugin->save(); |
||
| 51 | |||
| 52 | $plugin = new Plugin; |
||
| 53 | $plugin->setName('pages'); |
||
| 54 | $plugin->setVersion('1.0'); |
||
| 55 | $plugin->setIcon('fa-paperclip'); |
||
| 56 | $plugin->setEnabled(true); |
||
| 57 | $plugin->setFrontEnd(true); |
||
| 58 | $plugin->setBackEnd(true); |
||
| 59 | $plugin->save(); |
||
| 60 | |||
| 61 | $plugin = new Plugin; |
||
| 62 | $plugin->setName('news'); |
||
| 63 | $plugin->setVersion('1.0'); |
||
| 64 | $plugin->setIcon('fa-newspaper-o'); |
||
| 65 | $plugin->setFrontEnd(true); |
||
| 66 | $plugin->setBackEnd(true); |
||
| 67 | $plugin->save(); |
||
| 68 | |||
| 69 | $plugin = new Plugin; |
||
| 70 | $plugin->setName('redirects'); |
||
| 71 | $plugin->setVersion('1.0'); |
||
| 72 | $plugin->setIcon('fa-magic'); |
||
| 73 | $plugin->setFrontEnd(true); |
||
| 74 | $plugin->setBackEnd(true); |
||
| 75 | $plugin->save(); |
||
| 76 | |||
| 77 | $plugin = new Plugin; |
||
| 78 | $plugin->setName('facebook'); |
||
| 79 | $plugin->setVersion('2.8'); |
||
| 80 | $plugin->setIcon('fa-facebook-official'); |
||
| 81 | $plugin->setHide(true); |
||
| 82 | $plugin->setFrontEnd(true); |
||
| 83 | $plugin->setBackEnd(true); |
||
| 84 | $plugin->save(); |
||
| 85 | } |
||
| 97 |