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: ANNOTATION_TO_ATTRIBUTE.md
+5-13Lines changed: 5 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Overview
4
4
5
-
Ray.AuraSqlModule v2.x has removed the dependency on `doctrine/annotations` and now exclusively uses native PHP 8 attributes. This guide will help you migrate your application code from Doctrine annotations to PHP 8 attributes.
5
+
Ray.AuraSqlModule v1.15+ has removed the dependency on `doctrine/annotations` and now exclusively uses native PHP 8 attributes. This guide will help you migrate your application code from Doctrine annotations to PHP 8 attributes.
6
6
7
7
## Why Migrate?
8
8
@@ -15,23 +15,15 @@ Ray.AuraSqlModule v2.x has removed the dependency on `doctrine/annotations` and
15
15
16
16
## Migration Steps
17
17
18
-
### Step 1: Update Ray.AuraSqlModule
19
-
20
-
First, ensure you're using Ray.AuraSqlModule v2.x:
21
-
22
-
```bash
23
-
composer require ray/aura-sql-module:^2.0
24
-
```
25
-
26
-
### Step 2: Install Rector (if not already installed)
18
+
### Step 1: Install Rector (if not already installed)
27
19
28
20
Rector is an automated refactoring tool that can convert annotations to attributes:
29
21
30
22
```bash
31
23
composer require --dev rector/rector
32
24
```
33
25
34
-
### Step 3: Run Automated Migration
26
+
### Step 2: Run Automated Migration
35
27
36
28
Ray.AuraSqlModule provides a Rector configuration file for automated migration:
37
29
@@ -49,15 +41,15 @@ If you have tests that use annotations:
49
41
vendor/bin/rector process tests --config=vendor/ray/aura-sql-module/rector-migrate.php
50
42
```
51
43
52
-
### Step 4: Manual Review
44
+
### Step 3: Manual Review
53
45
54
46
Review the changes made by Rector and adjust if necessary. Pay special attention to:
55
47
56
48
- Multi-line annotations with complex values
57
49
- Annotations with custom parameters
58
50
- Import statements (Rector should handle these automatically)
59
51
60
-
### Step 5: Remove doctrine/annotations
52
+
### Step 4: Remove doctrine/annotations
61
53
62
54
After migration, you can safely remove the doctrine/annotations dependency:
0 commit comments