Skip to content

Commit 538c9f0

Browse files
committed
fix(stubs): Add toResponse to response
1 parent 0cdd56e commit 538c9f0

File tree

4 files changed

+11
-21
lines changed

4 files changed

+11
-21
lines changed

.phpunit.result.cache

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +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}}
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":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}}

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

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

5+
## 1.0.1 - 2023-03-31
6+
7+
### Fixed
8+
9+
- Add `toResponse` method to `Response` class.
10+
511
## 1.0.0 - 2023-03-17
612

713
First release with the following features:

src/Commands/Generators/stubs/response.php.stub

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ use Illuminate\Contracts\Support\Responsable;
88

99
final class {{ class }} implements Responsable
1010
{
11-
//
11+
public function toResponse($request)
12+
{
13+
// TODO: Implement toResponse() method.
14+
}
1215
}

tests/Feature/ResponseClassGeneratorCommandTest.php

-19
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,4 @@
2525

2626
// Assert a new file is created
2727
$this->assertTrue(File::exists($fooClass));
28-
29-
// Assert the file contains the right contents
30-
$expectedContents = <<<CLASS
31-
<?php
32-
33-
declare(strict_types=1);
34-
35-
namespace App\Http\Responses;
36-
37-
use Illuminate\Contracts\Support\Responsable;
38-
39-
final class MyFooClass implements Responsable
40-
{
41-
//
42-
}
43-
44-
CLASS;
45-
46-
$this->assertEquals($expectedContents, file_get_contents($fooClass));
4728
});

0 commit comments

Comments
 (0)