8000 [11.x] Extract `ShowModelCommand` functionality to separate class by cosmastech · Pull Request #53541 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[11.x] Extract ShowModelCommand functionality to separate class #53541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Nov 18, 2024
Prev Previous commit
rename method
  • Loading branch information
taylorotwell committed Nov 18, 2024
commit 75492866619ba56173f4feeabbe4065fd8cbc2d2
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Console/ShowModelCommand.php
8000
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class ShowModelCommand extends DatabaseInspectionCommand
*
* @return int
*/
public function handle(ModelInspector $modelInfoExtractor)
public function handle(ModelInspector $modelInspector)
{
try {
$info = $modelInfoExtractor->handle(
$info = $modelInspector->inspect(
$this->argument('model'),
$this->option('database')
);
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/ModelInspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(Application $app)
*
* @throws BindingResolutionException
*/
public function handle($model, $connection = null)
public function inspect($model, $connection = null)
{
$class = $this->qualifyModel($model);

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Database/ModelInspectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function afterRefreshingDatabase()
public function test_extracts_model_data()
{
$extractor = new ModelInspector($this->app);
$modelInfo = $extractor->handle(ModelInspectorTestModel::class);
$modelInfo = $extractor->inspect(ModelInspectorTestModel::class);
$this->assertModelInfo($modelInfo);
}

Expand Down
0