diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index f9cc80c..932a05a 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -761,11 +761,13 @@ class ModelsCommand extends Command } } - public function unsetMethod($name) { + public function unsetMethod($name) + { unset($this->methods[strtolower($name)]); } - public function getMethodType(Model $model, string $classType) { + public function getMethodType(Model $model, string $classType) + { $modelName = $this->getClassNameInDestinationFile($model, get_class($model)); $builder = $this->getClassNameInDestinationFile($model, $classType); return $builder . '|' . $modelName; diff --git a/tests/Console/ModelsCommand/ModelHooks/Hooks/UnsetMethod.php b/tests/Console/ModelsCommand/ModelHooks/Hooks/UnsetMethod.php index 17629ea..6dfad54 100644 --- a/tests/Console/ModelsCommand/ModelHooks/Hooks/UnsetMethod.php +++ b/tests/Console/ModelsCommand/ModelHooks/Hooks/UnsetMethod.php @@ -6,7 +6,6 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks use Barryvdh\LaravelIdeHelper\Console\ModelsCommand; use Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface; -use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; class UnsetMethod implements ModelHookInterface diff --git a/tests/Console/ModelsCommand/ModelHooks/Test.php b/tests/Console/ModelsCommand/ModelHooks/Test.php index 1bb7231..05ffea2 100644 --- a/tests/Console/ModelsCommand/ModelHooks/Test.php +++ b/tests/Console/ModelsCommand/ModelHooks/Test.php @@ -6,8 +6,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks; use Barryvdh\LaravelIdeHelper\Console\ModelsCommand; use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand; -use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\CustomProperty; use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\CustomMethod; +use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\CustomProperty; use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\UnsetMethod; use Illuminate\Filesystem\Filesystem; use Mockery; @@ -27,7 +27,7 @@ class Test extends AbstractModelsCommand 'model_hooks' => [ CustomProperty::class, CustomMethod::class, - UnsetMethod::class + UnsetMethod::class, ], ]); }