You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-15Lines changed: 12 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,16 @@
3
3
4
4
This package provides a [Rector](https://github.com/rectorphp/rector) rule to automatically convert most Scribe v3 docblock tags to v4 PHP 8 attributes.
5
5
6
-
This package will smartly transform the following tags to their attribute equivalents:
6
+
This package **will** smartly transform the following tags on controller methods to their attribute equivalents:
7
7
8
-
-`header`
9
-
-`urlParam`, `queryParam`, and `bodyParam`
10
-
-`responseField`
11
-
-`response`
12
-
-`responseFile`
8
+
-`header`, `urlParam`, `queryParam`, and `bodyParam`
9
+
-`responseField`, `response` and `responseFile`
13
10
-`apiResource`,`apiResourceCollection`, and `apiResourceModel`
14
11
-`transformer`, `transformerCollection`, and `transformerModel`
15
12
-`subgroup`
16
13
-`authenticated` and `unauthenticated`
17
14
18
-
It won't transform `@group` tags or endpoint titles and descriptions (because they can look ugly as attributes).
15
+
It **won't** transform `@group` tags or endpoint titles and descriptions (because they can look ugly as attributes).
19
16
20
17
It will only work on methods in classes. Unfortunately, attributes can't be added to inline (closure) routes in a neat way.
21
18
@@ -39,24 +36,24 @@ Example:
39
36
+ #[Subgroup('Getting started', 'Get started doing stuff')]
40
37
+ #[Header('Test', 'Value')]
41
38
+ #[Response(status: 204, description: '204, Nothing to see here')]
- Do a dry run. This will tell Rector to print out the changes that will be made, without actually making them. That way you can inspect and verify that it looks okay. We also recommend doing a `git commit`.
76
73
```sh
77
-
./vendor/bin/rector process --dry-run --clear-cache
74
+
./vendor/bin/rector process --dry-run --clear-cache
78
75
```
79
76
80
77
- When you're ready, run the command.
81
78
```sh
82
-
./vendor/bin/rector process --clear-cache
79
+
./vendor/bin/rector process --clear-cache
83
80
```
84
-
-Finally, make sure to add the attribute strategies to your `config/scribe.php`:
81
+
-Make sure to add the attribute strategies to your `config/scribe.php`:
0 commit comments