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 | 85 |
| Code Lines | 53 |
| 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 |
||
| 18 | public function up() |
||
| 19 | { |
||
| 20 | $plugin = new Plugin; |
||
| 21 | |||
| 22 | $plugin->setAttribute('name', 'articles'); |
||
| 23 | $plugin->setAttribute('version', '1.0'); |
||
| 24 | $plugin->setAttribute('icon', 'fa-book'); |
||
| 25 | $plugin->setAttribute('enabled', false); |
||
| 26 | $plugin->setAttribute('is_frontend', true); |
||
| 27 | $plugin->setAttribute('is_backend', true); |
||
| 28 | $plugin->setAttribute('required', false); |
||
| 29 | $plugin->save(); |
||
| 30 | |||
| 31 | /** @var \App\Classes\Repositories\PluginRepository $pluginRepository */ |
||
| 32 | $pluginRepository = app(\App\Classes\Repositories\PluginRepository::class); |
||
| 33 | |||
| 34 | $pluginRepository->whereName('menus')->setAttribute('required', true)->save(); |
||
| 35 | $pluginRepository->whereName('pages')->setAttribute('required', true)->save(); |
||
| 36 | |||
| 37 | Schema::table('plugins', function (Blueprint $table) { |
||
| 38 | $table->dropColumn('version'); |
||
| 39 | $table->dropColumn('icon'); |
||
| 40 | }); |
||
| 41 | |||
| 42 | Schema::create('articles', function (Blueprint $table) { |
||
| 43 | $table->increments('id'); |
||
| 44 | $table->string('slug'); |
||
| 45 | $table->string('title'); |
||
| 46 | $table->longText('content'); |
||
| 47 | $table->string('featured_img')->nullable(); |
||
| 48 | $table->integer('views')->default(0); |
||
| 49 | $table->integer('sitemap')->default(1); |
||
| 50 | $table->unsignedInteger('category_id')->nullable(); |
||
| 51 | $table->integer('editor_id'); |
||
| 52 | $table->integer('creator_id'); |
||
| 53 | $table->boolean('status')->default(1); |
||
| 54 | $table->softDeletes(); |
||
| 55 | $table->timestamps(); |
||
| 56 | }); |
||
| 57 | |||
| 58 | Schema::create('article_categories', function (Blueprint $table) { |
||
| 59 | $table->increments('id'); |
||
| 60 | $table->string('title'); |
||
| 61 | $table->boolean('status')->default(1); |
||
| 62 | $table->integer('editor_id'); |
||
| 63 | $table->integer('creator_id'); |
||
| 64 | $table->softDeletes(); |
||
| 65 | $table->timestamps(); |
||
| 66 | }); |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Store a General category. |
||
| 70 | */ |
||
| 71 | $category = new ArticleCategory; |
||
| 72 | $category->setAttribute('title', 'General'); |
||
| 73 | $category->setAttribute('editor_id', 1); |
||
| 74 | $category->setAttribute('creator_id', 1); |
||
| 75 | $category->touch(); |
||
| 76 | $category->save(); |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Store youtube url. |
||
| 80 | */ |
||
| 81 | $setting = new Setting; |
||
| 82 | $setting->setAttribute('key', 'youtube_url'); |
||
| 83 | $setting->save(); |
||
| 84 | |||
| 85 | /** |
||
| 86 | * Store facebook url. |
||
| 87 | */ |
||
| 88 | $setting = new Setting; |
||
| 89 | $setting->setAttribute('key', 'facebook_url'); |
||
| 90 | $setting->save(); |
||
| 91 | |||
| 92 | /** |
||
| 93 | * Store twitter url. |
||
| 94 | */ |
||
| 95 | $setting = new Setting; |
||
| 96 | $setting->setAttribute('key', 'twitter_url'); |
||
| 97 | $setting->save(); |
||
| 98 | |||
| 99 | /* |
||
| 100 | * INDEX ALL NEW MATERIAL FOR SEARCHING. |
||
| 101 | */ |
||
| 102 | Artisan::call('scout:mysql-index'); |
||
| 103 | } |
||
| 115 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.