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
feature #59075 [Uid] Add `@return non-empty-string annotations to AbstractUid` and relevant functions (niravpateljoin)
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#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
0 commit comments