Skip to content

Conversation

solomon-ochepa
Copy link
Contributor

Refactor stubs:

  • Update response structure in controllers, simplify method implementations, and adjust route middleware

Refactor test snapshots:

  • Updated controller methods in snapshots to use single-line syntax for empty methods like create, show, edit, etc.
  • Changed Blade component namespace registration to use a dynamic namespace generation method in multiple service provider tests.
  • Adjusted API response structures in generated controllers to include success status and data placeholders.
  • Refined factory and model snapshots to improve clarity and consistency in generated code.

…thod implementations, and adjust route middleware
- Updated controller methods in snapshots to use single-line syntax for empty methods like create, show, edit, etc.
- Changed Blade component namespace registration to use a dynamic namespace generation method in multiple service provider tests.
- Adjusted API response structures in generated controllers to include success status and data placeholders.
- Refined factory and model snapshots to improve clarity and consistency in generated code.
@piotrczech
Copy link

Hey!

I’m curious about the motivation behind these specific changes to the stubs and test snapshots. Wouldn’t it make sense to keep the custom stubs closer to the default ones generated by artisan make:model (like in Laravel 12)?

For example, the default model stub looks clean and minimal:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class ExampleModel extends Model
{
    //
}

@solomon-ochepa
Copy link
Contributor Author

Hey!

I’m curious about the motivation behind these specific changes to the stubs and test snapshots. Wouldn’t it make sense to keep the custom stubs closer to the default ones generated by artisan make:model (like in Laravel 12)?

For example, the default model stub looks clean and minimal:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class ExampleModel extends Model
{
    //
}

In PHP, empty code blocks, or those containing no executable code, should ideally be collapsed to improve code readability and maintainability.

Why collapse empty blocks?

Improved Readability:

Empty blocks can be visually distracting and make it harder to understand the intended logic of the code. Collapsing them cleans up the code and focuses attention on the relevant parts.

###Reduced Noise:
When reviewing or debugging code, collapsing empty blocks helps to filter out the noise and focus on the active code sections.

Preventing Errors:

Empty blocks can sometimes indicate incomplete logic or potential bugs. Collapsing them can highlight these areas and encourage developers to address them.

@solomon-ochepa
Copy link
Contributor Author

Hi, @dcblogdev. Is there any issue with this PR that prevents it from being merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants