File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 38
38
use Symfony \Component \Mailer \MailerInterface ;
39
39
use Symfony \Component \Routing \RouterInterface ;
40
40
use Symfony \Component \Validator \Validation ;
41
+ use SymfonyCasts \Bundle \VerifyEmail \Model \VerifyEmailSignatureComponents ;
41
42
use SymfonyCasts \Bundle \VerifyEmail \SymfonyCastsVerifyEmailBundle ;
42
43
43
44
/**
@@ -368,7 +369,15 @@ private function getMissingComponentsComposerMessage(): ?string
368
369
$ missing = false ;
369
370
$ composerMessage = 'composer require ' ;
370
371
371
- if (!class_exists (SymfonyCastsVerifyEmailBundle::class)) {
372
+ // verify-email-bundle 1.2 includes support for translations and a fix for the bad expiration time bug.
373
+ // we need to check that if the bundle is installed, it is version 1.2 or greater
374
+ if (class_exists (SymfonyCastsVerifyEmailBundle::class)) {
375
+ $ reflectedComponents = new \ReflectionClass (VerifyEmailSignatureComponents::class);
376
+
377
+ if (!$ reflectedComponents ->hasMethod ('getExpirationMessageKey ' )) {
378
+ throw new RuntimeCommandException ('Please upgrade symfonycasts/verify-email-bundle to version 1.2.0 or greater. ' );
379
+ }
380
+ } else {
372
381
$ missing = true ;
373
382
$ composerMessage = sprintf ('%s symfonycasts/verify-email-bundle ' , $ composerMessage );
374
383
}
Original file line number Diff line number Diff line change 35
35
use Symfony \Component \Yaml \Yaml ;
36
36
use SymfonyCasts \Bundle \ResetPassword \Model \ResetPasswordRequestInterface ;
37
37
use SymfonyCasts \Bundle \ResetPassword \Model \ResetPasswordRequestTrait ;
38
+ use SymfonyCasts \Bundle \ResetPassword \Model \ResetPasswordToken ;
38
39
use SymfonyCasts \Bundle \ResetPassword \Persistence \Repository \ResetPasswordRequestRepositoryTrait ;
39
40
use SymfonyCasts \Bundle \ResetPassword \Persistence \ResetPasswordRequestRepositoryInterface ;
40
41
use SymfonyCasts \Bundle \ResetPassword \SymfonyCastsResetPasswordBundle ;
@@ -82,6 +83,14 @@ public function configureDependencies(DependencyBuilder $dependencies)
82
83
ORMDependencyBuilder::buildDependencies ($ dependencies );
83
84
84
85
$ dependencies ->addClassDependency (Annotation::class, 'annotations ' );
86
+
87
+ // reset-password-bundle 1.3 includes support for translations and a fix for the bad expiration time bug.
88
+ // we need to check that version 1.3 is installed
89
+ $ reflectedToken = new \ReflectionClass (ResetPasswordToken::class);
90
+
91
+ if (!$ reflectedToken ->hasMethod ('getExpirationMessageKey ' )) {
92
+ throw new RuntimeCommandException ('Please upgrade symfonycasts/reset-password-bundle to version 1.3.0 or greater. ' );
93
+ }
85
94
}
86
95
87
96
public function interact (InputInterface $ input , ConsoleStyle $ io , Command $ command )
You can’t perform that action at this time.
0 commit comments