Skip to content

Commit

Permalink
- Optimized all the stubs and docblocks (#35)
Browse files Browse the repository at this point in the history
* - Optimized all the stubs and docblocks

* Add Import to Model Stub

* Remove the import from the Model Stub
Clean up the imports on the Controller Stub

Related to issue #32 

Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
2 people authored and andreacivita committed Oct 23, 2021
1 parent 638ceb4 commit 1728fe3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/stubs/Controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class {{modelName}}Controller extends Controller
/**
* Update the specified resource in storage.
*
* @param \App\Http\Requests\{{modelName}}Request $request
* @param \App\Models\{{modelName}} ${{modelNameSingularLowerCase}}
* @param {{modelName}}Request $request
* @param {{modelName}} ${{modelNameSingularLowerCase}}
* @return {{modelName}}Resource
*/
public function update({{modelName}}Request $request, {{modelName}} ${{modelNameSingularLowerCase}})
Expand All @@ -64,7 +64,7 @@ class {{modelName}}Controller extends Controller
/**
* Remove the specified resource from storage.
*
* @param \App\Models\{{modelName}} ${{modelNameSingularLowerCase}}
* @param {{modelName}} ${{modelNameSingularLowerCase}}
* @return JsonResponse
*/
public function destroy({{modelName}} ${{modelNameSingularLowerCase}})
Expand Down
6 changes: 3 additions & 3 deletions src/stubs/Test.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use App\Model\{{modelName}};
class {{modelName}}Test extends TestCase
{

/** @var \App\Models\{{modelName}} */
/** @var {{modelName}} */
protected ${{modelNameSingularLowerCase}};

/**
Expand All @@ -20,7 +20,7 @@ class {{modelName}}Test extends TestCase
{
parent::setUp();

$this->{{modelNameSingularLowerCase}} = \App\Models\{{modelName}}::factory()->make();
$this->{{modelNameSingularLowerCase}} = {{modelName}}::factory()->make();
}

/**
Expand Down Expand Up @@ -77,7 +77,7 @@ class {{modelName}}Test extends TestCase
*/
public function testDestroy() : void
{
$id = \App\Models\{{modelName}}::all()->last()->id;
$id = {{modelName}}::all()->last()->id;

$this->deleteJson('/api/{{modelNameSingularLowerCase}}/'.$id)
->assertSuccessful();
Expand Down

0 comments on commit 1728fe3

Please sign in to comment.