Passed
Push — feature/add-configurable-sso-r... ( 479d24...71cae6 )
by
unknown
05:57
created
src/Surfnet/StepupMiddleware/ApiBundle/Request/CommandValueResolver.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
         $this->assertIsValidCommandStructure($data);
45 45
 
46 46
         $commandNameParts = [];
47
-        $found = preg_match('~^(\w+):([\w\\.]+)$~', (string)$data['command']['name'], $commandNameParts);
47
+        $found = preg_match('~^(\w+):([\w\\.]+)$~', (string) $data['command']['name'], $commandNameParts);
48 48
         if ($found !== 1) {
49
-            $message = sprintf('Command does not have a valid command name %s', (string)$data['command']['name']);
49
+            $message = sprintf('Command does not have a valid command name %s', (string) $data['command']['name']);
50 50
             throw new BadCommandRequestException(
51 51
                 [$message],
52 52
                 $message,
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
 
61 61
         /** @var AbstractCommand $command */
62 62
         $command = new $commandClassName;
63
-        $command->UUID = (string)$data['command']['uuid'];
63
+        $command->UUID = (string) $data['command']['uuid'];
64 64
 
65
-        foreach ((array)$data['command']['payload'] as $property => $value) {
66
-            $properlyCasedProperty = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', (string)$property))));
65
+        foreach ((array) $data['command']['payload'] as $property => $value) {
66
+            $properlyCasedProperty = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', (string) $property))));
67 67
             $command->$properlyCasedProperty = $value;
68 68
         }
69 69
 
Please login to merge, or discard this patch.
src/Surfnet/Stepup/Identity/Event/IdentityRestoredEvent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@
 block discarded – undo
51 51
     public function serialize(): array
52 52
     {
53 53
         return [
54
-            'id' => (string)$this->id,
55
-            'institution' => (string)$this->institution,
56
-            'common_name' => (string)$this->commonName,
57
-            'email' => (string)$this->email,
54
+            'id' => (string) $this->id,
55
+            'institution' => (string) $this->institution,
56
+            'common_name' => (string) $this->commonName,
57
+            'email' => (string) $this->email,
58 58
         ];
59 59
     }
60 60
 
Please login to merge, or discard this patch.
Surfnet/StepupMiddleware/ApiBundle/Identity/Projector/IdentityProjector.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $this->identityRepository->save(
44 44
             Identity::create(
45
-                (string)$event->identityId,
45
+                (string) $event->identityId,
46 46
                 $event->identityInstitution,
47 47
                 $event->nameId,
48 48
                 $event->email,
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function applyIdentityRenamedEvent(IdentityRenamedEvent $event): void
56 56
     {
57
-        $identity = $this->identityRepository->find((string)$event->identityId);
57
+        $identity = $this->identityRepository->find((string) $event->identityId);
58 58
         $identity->commonName = $event->commonName;
59 59
 
60 60
         $this->identityRepository->save($identity);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function applyIdentityEmailChangedEvent(IdentityEmailChangedEvent $event): void
64 64
     {
65
-        $identity = $this->identityRepository->find((string)$event->identityId);
65
+        $identity = $this->identityRepository->find((string) $event->identityId);
66 66
         $identity->email = $event->email;
67 67
 
68 68
         $this->identityRepository->save($identity);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     public function applyLocalePreferenceExpressedEvent(LocalePreferenceExpressedEvent $event): void
72 72
     {
73
-        $identity = $this->identityRepository->find((string)$event->identityId);
73
+        $identity = $this->identityRepository->find((string) $event->identityId);
74 74
         $identity->preferredLocale = $event->preferredLocale;
75 75
 
76 76
         $this->identityRepository->save($identity);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
     public function applyIdentityRestoredEvent(IdentityRestoredEvent $event): void
80 80
     {
81
-        $identity = $this->identityRepository->find((string)$event->identityId);
81
+        $identity = $this->identityRepository->find((string) $event->identityId);
82 82
         $identity->email = $event->email;
83 83
         $identity->commonName = $event->commonName;
84 84
 
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function applySecondFactorVettedEvent(SecondFactorVettedEvent $event): void
90 90
     {
91
-        $this->determinePossessionOfSelfAssertedToken($event->vettingType, (string)$event->identityId);
91
+        $this->determinePossessionOfSelfAssertedToken($event->vettingType, (string) $event->identityId);
92 92
     }
93 93
 
94 94
     public function applySecondFactorVettedWithoutTokenProofOfPossession(
95 95
         SecondFactorVettedWithoutTokenProofOfPossession $event,
96 96
     ): void {
97
-        $this->determinePossessionOfSelfAssertedToken($event->vettingType, (string)$event->identityId);
97
+        $this->determinePossessionOfSelfAssertedToken($event->vettingType, (string) $event->identityId);
98 98
     }
99 99
 
100 100
     private function determinePossessionOfSelfAssertedToken(VettingType $vettingType, string $identityId): void
Please login to merge, or discard this patch.
ApiBundle/Doctrine/Type/SsoRegistrationBypassOptionType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
                     "Encountered illegal sso registration bypass option %s '%s', expected a 
51 51
                     SsoRegistrationBypassOption instance",
52 52
                     get_debug_type($value),
53
-                    is_scalar($value) ? (string)$value : '',
53
+                    is_scalar($value) ? (string) $value : '',
54 54
                 ),
55 55
             );
56 56
         }
57 57
 
58
-        return (int)$value->isEnabled();
58
+        return (int) $value->isEnabled();
59 59
     }
60 60
 
61 61
     public function convertToPHPValue($value, AbstractPlatform $platform): ?SsoRegistrationBypassOption
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         }
66 66
 
67 67
         try {
68
-            $ssoRegistrationBypassOption = new SsoRegistrationBypassOption((bool)$value);
68
+            $ssoRegistrationBypassOption = new SsoRegistrationBypassOption((bool) $value);
69 69
         } catch (TypeError $e) {
70 70
             // get nice standard message, so we can throw it keeping the exception chain
71 71
             $doctrineExceptionMessage = ConversionException::conversionFailed(
Please login to merge, or discard this patch.
GatewayBundle/Projector/InstitutionConfigurationProjector.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     public function applyNewInstitutionConfigurationCreatedEvent(NewInstitutionConfigurationCreatedEvent $event): void
39 39
     {
40 40
         $institutionConfiguration = new InstitutionConfiguration(
41
-            (string)$event->institution,
41
+            (string) $event->institution,
42 42
             $event->ssoOn2faOption->isEnabled(),
43 43
             $event->ssoRegistrationBypassOption->isEnabled(),
44 44
         );
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function applySsoOn2faOptionChangedEvent(SsoOn2faOptionChangedEvent $event): void
50 50
     {
51
-        $institutionConfiguration = $this->repository->findByInstitution((string)$event->institution);
51
+        $institutionConfiguration = $this->repository->findByInstitution((string) $event->institution);
52 52
         if ($institutionConfiguration instanceof InstitutionConfiguration) {
53 53
             $institutionConfiguration->ssoOn2faEnabled = $event->ssoOn2faOption->isEnabled();
54 54
             $this->repository->save($institutionConfiguration);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         // It can happen that the event changed for an institution that already exists, but is not yet projected to
58 58
         // this projection. In that case we can create it.
59 59
         $institutionConfiguration = new InstitutionConfiguration(
60
-            (string)$event->institution,
60
+            (string) $event->institution,
61 61
             $event->ssoOn2faOption->isEnabled(),
62 62
             false,
63 63
         );
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
     public function applySsoRegistrationBypassOptionChangedEvent(SsoRegistrationBypassOptionChangedEvent $event): void
68 68
     {
69
-        $institutionConfiguration = $this->repository->findByInstitution((string)$event->institution);
69
+        $institutionConfiguration = $this->repository->findByInstitution((string) $event->institution);
70 70
         if ($institutionConfiguration instanceof InstitutionConfiguration) {
71 71
             $institutionConfiguration->ssoRegistrationBypass = $event->ssoRegistrationBypassOption->isEnabled();
72 72
             $this->repository->save($institutionConfiguration);
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         // It can happen that the event changed for an institution that already exists, but is not yet projected to
76 76
         // this projection. In that case we can create it.
77 77
         $institutionConfiguration = new InstitutionConfiguration(
78
-            (string)$event->institution,
78
+            (string) $event->institution,
79 79
             false,
80 80
             $event->ssoRegistrationBypassOption->isEnabled(),
81 81
         );
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     public function applyInstitutionConfigurationRemovedEvent(InstitutionConfigurationRemovedEvent $event): void
86 86
     {
87
-        $this->repository->removeFor((string)$event->institution);
87
+        $this->repository->removeFor((string) $event->institution);
88 88
     }
89 89
 
90 90
     protected function applyIdentityForgottenEvent(IdentityForgottenEvent $event): void
Please login to merge, or discard this patch.