Commit e6113e8
Improve error handling, validation and code quality
Applied fixes for issues #2, #3, #4 and medium priority improvements:
**Issue #2: Add preg_match() validation in Short converter**
- src/Converter/Short.php: Check preg_match return value before using matches
- Throw descriptive RuntimeException if hex format is invalid
**Issue #3: Add descriptive exception messages to Reverser classes**
- src/Reverser/ReverseBinary.php: Add error message with actual byte length
- src/Reverser/ReverseHex.php: Add error message showing expected vs actual format
- src/Reverser/ReverseShortened.php: Add error message for full-length UUID rejection
**Issue #4: Fix misleading PHPDoc in ExposeBehavior**
- src/Model/Behavior/ExposeBehavior.php: Remove incorrect @throws tag about 'slug' key
- The method signature already shows it takes string $uuid directly
**Medium #1: Add file validation for migration command**
- src/Command/AddExposedFieldCommand.php: Validate migration path exists and is writable
- Add error handling for file_put_contents() failure
**Medium #3: Improve error message in ExposeBehavior**
- src/Model/Behavior/ExposeBehavior.php: Show actual column type in error message
- Helps debugging when column type cannot be determined
**Medium #6: Document SuperimposeComponent config**
- src/Controller/Component/SuperimposeComponent.php: Add inline comment explaining actions array
All changes improve error handling, make debugging easier, and prevent
potential bugs from unchecked return values.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ddf649c commit e6113e8
File tree
7 files changed
+21
-8
lines changed- src
- Command
- Controller/Component
- Converter
- Model/Behavior
- Reverser
7 files changed
+21
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
105 | 114 | | |
106 | 115 | | |
107 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
208 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
0 commit comments