Commit 12ff1bf
committed
feature symfony#59075 [Uid] Add `
This PR was merged into the 7.3 branch.
Discussion
----------
[Uid] Add ``@return` non-empty-string` annotations to `AbstractUid` and relevant functions
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issue | Fix symfony#59076
| License | MIT
This Merge Request introduces ``@return` non-empty-string` annotations to the AbstractUid class and other relevant functions in the Symfony UID component. By explicitly defining the return type as non-empty-string, this change improves type safety and ensures stricter static analysis when working with UIDs.
### Rationale
- Symfony 7.3 has adopted stricter type safety guidelines, including support for non-empty-string in interfaces like UserInterface::getUserIdentifier. Aligning the UID component with these standards improves consistency across the framework.
- Adding these annotations benefits developers by providing enhanced autocompletion and error detection in IDEs and tools like Psalm and PHPStan.
### Changes Made
- Updated PHPDoc comments in AbstractUid and related classes to specify ``@return` non-empty-string` for methods where applicable.
- Verified all usages of these methods to ensure compatibility with the stricter return type.
### Backward Compatibility
- This change does not affect backward compatibility, as it only updates PHPDoc annotations. The runtime behavior of the methods remains the same.
Commits
-------
41dacf7 Add `@return` non-empty-string annotations to AbstractUid and relevant functions@return non-empty-string annotations to AbstractUid` and relevant functions (niravpateljoin)1 file changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
| |||
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| 136 | + | |
| 137 | + | |
130 | 138 | | |
131 | 139 | | |
132 | 140 | | |
| |||
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
| 154 | + | |
| 155 | + | |
146 | 156 | | |
147 | 157 | | |
148 | 158 | | |
| |||
161 | 171 | | |
162 | 172 | | |
163 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
164 | 177 | | |
165 | 178 | | |
166 | 179 | | |
| |||
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
174 | 190 | | |
175 | 191 | | |
176 | 192 | | |
177 | 193 | | |
178 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
179 | 198 | | |
180 | 199 | | |
181 | 200 | | |
182 | 201 | | |
183 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
184 | 206 | | |
185 | 207 | | |
186 | 208 | | |
| |||
0 commit comments