Skip to content

Use generics to precise User class - #361

Open
VincentLanglet wants to merge 1 commit into
SymfonyCasts:mainfrom
VincentLanglet:generics
Open

Use generics to precise User class#361
VincentLanglet wants to merge 1 commit into
SymfonyCasts:mainfrom
VincentLanglet:generics

Conversation

@VincentLanglet

@VincentLanglet VincentLanglet commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Hi @bocharsky-bw

These generics are useful for static analysis like PHPStan or psalm, because it allows to precise the return type or the expected param of some methods (instead of a general object one).

The only failure is

1) src/Model/ResetPasswordRequestTrait.php
      ---------- begin diff ----------
--- /home/runner/work/reset-password-bundle/reset-password-bundle/src/Model/ResetPasswordRequestTrait.php
+++ /home/runner/work/reset-password-bundle/reset-password-bundle/src/Model/ResetPasswordRequestTrait.php
@@ -52,7 +52,7 @@
     protected $expiresAt;
 
     /** @return void */
-    protected function initialize(\DateTimeInterface $expiresAt, string $selector, string $hashedToken)
+    protected function initialize(\DateTimeInterface $expiresAt, string $selector, string $hashedToken): void
     {
         $this->requestedAt = Clock::get()->now();
         $this->expiresAt = $expiresAt;

which is unrelated and already exists.

@VincentLanglet
VincentLanglet marked this pull request as ready for review July 15, 2026 21:05
@VincentLanglet

VincentLanglet commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping @bocharsky-bw Should i fix the existing CS failure too ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant