Skip to content

Commit

Permalink
fix(stubs): Add toResponse to response
Browse files Browse the repository at this point in the history
  • Loading branch information
alibori committed Mar 31, 2023
1 parent 0cdd56e commit 538c9f0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"defects":{"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\ArchTest.php::it":4,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ServiceClassGeneratorCommandTest.php::it":3,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ResponseClassGeneratorCommandTest.php::it":3},"times":{"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\ArchTest.php::it":0.169,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\LaravelFileGeneratorCommandTest.php::it":0.021,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\LaravelFileGeneratorCommandTest.php::it":0.019,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ServiceClassGeneratorCommandTest.php::it":0.026,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\RepositoryClassGeneratorCommandTest.php::it":0.249,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ActionClassGeneratorCommandTest.php::it":0.027,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ResponseClassGeneratorCommandTest.php::it":0.025}}
{"version":1,"defects":{"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\ArchTest.php::it":4,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ServiceClassGeneratorCommandTest.php::it":3,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ResponseClassGeneratorCommandTest.php::it":4},"times":{"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\ArchTest.php::it":0.169,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\LaravelFileGeneratorCommandTest.php::it":0.021,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\LaravelFileGeneratorCommandTest.php::it":0.023,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ServiceClassGeneratorCommandTest.php::it":0.028,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\RepositoryClassGeneratorCommandTest.php::it":0.276,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ActionClassGeneratorCommandTest.php::it":0.028,"C:\\laragon\\www\\custom-packages\\laravel-file-generator\\tests\\Feature\\ResponseClassGeneratorCommandTest.php::it":0.029}}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to `laravel-file-generator` will be documented in this file.

## 1.0.1 - 2023-03-31

### Fixed

- Add `toResponse` method to `Response` class.

## 1.0.0 - 2023-03-17

First release with the following features:
Expand Down
5 changes: 4 additions & 1 deletion src/Commands/Generators/stubs/response.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ use Illuminate\Contracts\Support\Responsable;

final class {{ class }} implements Responsable
{
//
public function toResponse($request)
{
// TODO: Implement toResponse() method.
}
}
19 changes: 0 additions & 19 deletions tests/Feature/ResponseClassGeneratorCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,4 @@

// Assert a new file is created
$this->assertTrue(File::exists($fooClass));

// Assert the file contains the right contents
$expectedContents = <<<CLASS
<?php
declare(strict_types=1);
namespace App\Http\Responses;
use Illuminate\Contracts\Support\Responsable;
final class MyFooClass implements Responsable
{
//
}
CLASS;

$this->assertEquals($expectedContents, file_get_contents($fooClass));
});

0 comments on commit 538c9f0

Please sign in to comment.