@@ -32,7 +32,8 @@ trait SSODataTrait
3232 */
3333 public function getBranchId (): ?string
3434 {
35- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_BRANCH_ID );
35+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_BRANCH_ID );
36+ return is_string ($ value ) ? $ value : null ;
3637 }
3738
3839 /**
@@ -42,7 +43,8 @@ public function getBranchId(): ?string
4243 */
4344 public function getBranchSlug (): ?string
4445 {
45- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_BRANCH_SLUG );
46+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_BRANCH_SLUG );
47+ return is_string ($ value ) ? $ value : null ;
4648 }
4749
4850 /**
@@ -52,7 +54,8 @@ public function getBranchSlug(): ?string
5254 */
5355 public function getSessionId (): ?string
5456 {
55- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_SESSION_ID );
57+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_SESSION_ID );
58+ return is_string ($ value ) ? $ value : null ;
5659 }
5760
5861 /**
@@ -64,7 +67,8 @@ public function getSessionId(): ?string
6467 */
6568 public function getInstanceId (): ?string
6669 {
67- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_INSTANCE_ID );
70+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_INSTANCE_ID );
71+ return is_string ($ value ) ? $ value : null ;
6872 }
6973
7074 /**
@@ -74,7 +78,8 @@ public function getInstanceId(): ?string
7478 */
7579 public function getInstanceName (): ?string
7680 {
77- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_INSTANCE_NAME );
81+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_INSTANCE_NAME );
82+ return is_string ($ value ) ? $ value : null ;
7883 }
7984
8085 /**
@@ -84,7 +89,8 @@ public function getInstanceName(): ?string
8489 */
8590 public function getUserId (): ?string
8691 {
87- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_ID );
92+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_ID );
93+ return is_string ($ value ) ? $ value : null ;
8894 }
8995
9096 /**
@@ -97,7 +103,8 @@ public function getUserId(): ?string
97103 */
98104 public function getUserExternalId (): ?string
99105 {
100- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_EXTERNAL_ID );
106+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_EXTERNAL_ID );
107+ return is_string ($ value ) ? $ value : null ;
101108 }
102109
103110 /**
@@ -107,7 +114,8 @@ public function getUserExternalId(): ?string
107114 */
108115 public function getUserUsername (): ?string
109116 {
110- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_USERNAME );
117+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_USERNAME );
118+ return is_string ($ value ) ? $ value : null ;
111119 }
112120
113121 /**
@@ -117,7 +125,8 @@ public function getUserUsername(): ?string
117125 */
118126 public function getUserPrimaryEmailAddress (): ?string
119127 {
120- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_PRIMARY_EMAIL_ADDRESS );
128+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_PRIMARY_EMAIL_ADDRESS );
129+ return is_string ($ value ) ? $ value : null ;
121130 }
122131
123132 /**
@@ -127,7 +136,8 @@ public function getUserPrimaryEmailAddress(): ?string
127136 */
128137 public function getFullName (): ?string
129138 {
130- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_FULL_NAME );
139+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_FULL_NAME );
140+ return is_string ($ value ) ? $ value : null ;
131141 }
132142
133143 /**
@@ -137,7 +147,8 @@ public function getFullName(): ?string
137147 */
138148 public function getFirstName (): ?string
139149 {
140- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_FIRST_NAME );
150+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_FIRST_NAME );
151+ return is_string ($ value ) ? $ value : null ;
141152 }
142153
143154 /**
@@ -147,20 +158,22 @@ public function getFirstName(): ?string
147158 */
148159 public function getLastName (): ?string
149160 {
150- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_LAST_NAME );
161+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_LAST_NAME );
162+ return is_string ($ value ) ? $ value : null ;
151163 }
152164
153165
154166 /**
155167 * Get the type of the token.
156168 *
157- * The type of the accessing entity can be either a “ user” or a “ token” .
169+ * The type of the accessing entity can be either a " user" or a " token" .
158170 *
159171 * @return null|string
160172 */
161173 public function getType (): ?string
162174 {
163- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_ENTITY_TYPE );
175+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_ENTITY_TYPE );
176+ return is_string ($ value ) ? $ value : null ;
164177 }
165178
166179 /**
@@ -172,7 +185,8 @@ public function getType(): ?string
172185 */
173186 public function getThemeTextColor (): ?string
174187 {
175- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_THEME_TEXT_COLOR );
188+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_THEME_TEXT_COLOR );
189+ return is_string ($ value ) ? $ value : null ;
176190 }
177191
178192 /**
@@ -184,7 +198,8 @@ public function getThemeTextColor(): ?string
184198 */
185199 public function getThemeBackgroundColor (): ?string
186200 {
187- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_THEME_BACKGROUND_COLOR );
201+ $ value = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_THEME_BACKGROUND_COLOR );
202+ return is_string ($ value ) ? $ value : null ;
188203 }
189204
190205 /**
@@ -194,7 +209,8 @@ public function getThemeBackgroundColor(): ?string
194209 */
195210 public function getLocale (): string
196211 {
197- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_LOCALE );
212+ $ val = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_LOCALE );
213+ return is_string ($ val ) ? $ val : '' ;
198214 }
199215
200216 /**
@@ -204,6 +220,7 @@ public function getLocale(): string
204220 */
205221 public function getTags (): ?array
206222 {
207- return $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_TAGS );
223+ $ val = $ this ->getClaimSafe (SSODataClaimsInterface::CLAIM_USER_TAGS );
224+ return is_array ($ val ) ? $ val : null ;
208225 }
209226}
0 commit comments