@@ -165,24 +165,20 @@ public function setHmacToken(?AccessToken $accessToken): self
165165 /**
166166 * Checks if the provided Access Token has expired.
167167 *
168- * @return false|true |null Returns true if Access Token has expired, false if not, and null if the expire field is null
168+ * @return bool |null Returns true if Access Token has expired, false if not, and null if the expire field is null
169169 */
170170 public function hasHmacTokenExpired (?AccessToken $ accessToken ): bool |null
171171 {
172- if (null === $ accessToken ->expires ) {
173- return null ;
174- }
175-
176- return $ accessToken ->expires ->isBefore (Time::now ());
172+ return $ accessToken ->expires !== null ? $ accessToken ->expires ->isBefore (Time::now ()) : null ;
177173 }
178174
179175 /**
180176 * Returns formatted date to expiration for provided Hmac Key/Token.
181177 *
182- * @param AcessToken $accessToken AccessToken
183- * @param string $format The return format - "date" or "human". Date is 'Y-m-d h:i:s', human is 'in 2 weeks'
178+ * @param AccessToken $accessToken AccessToken
179+ * @param string $format The return format - "date" or "human". Date is 'Y-m-d h:i:s', human is 'in 2 weeks'
184180 *
185- * @return false|true| null Returns true if Access Token has expired, false if not and null if the expire field is null
181+ * @return string| null Returns a formatted expiration date or null if the expire field is not set.
186182 *
187183 * @throws InvalidArgumentException
188184 */
@@ -207,10 +203,10 @@ public function getHmacTokenTimeToExpire(?AccessToken $accessToken, string $form
207203 /**
208204 * Sets an expiration for Hmac Key/Token by ID.
209205 *
210- * @param int $id AccessTokens ID
206+ * @param int $id AccessToken ID
211207 * @param string $expiresAt Expiration date. Accepts DateTime string formatted as 'Y-m-d h:i:s' or DateTime relative formats (1 day, 2 weeks, 6 months, 1 year) to be added to DateTime 'now'
212208 *
213- * @return false|true|null Returns true if token is updated, false if not .
209+ * @return bool Returns true if expiration date is set or updated .
214210 */
215211 public function setHmacTokenExpirationById (int $ id , string $ expiresAt ): bool
216212 {
0 commit comments