@@ -311,7 +311,7 @@ public function register(array $data, array $files = [])
311311 * @param string|null $ip
312312 * @return int Return positive number if rate limited, otherwise return 0.
313313 */
314- public function checkLoginRateLimit (string $ username , string $ ip = null ): int
314+ public function checkLoginRateLimit (string $ username , ? string $ ip = null ): int
315315 {
316316 $ ipKey = $ this ->getIpKey ($ ip );
317317 $ rateLimiter = $ this ->getRateLimiter ('login_attempts ' );
@@ -330,7 +330,7 @@ public function checkLoginRateLimit(string $username, string $ip = null): int
330330 * @param string $username
331331 * @param string|null $ip
332332 */
333- public function resetLoginRateLimit (string $ username , string $ ip = null ): void
333+ public function resetLoginRateLimit (string $ username , ? string $ ip = null ): void
334334 {
335335 $ ipKey = $ this ->getIpKey ($ ip );
336336 $ rateLimiter = $ this ->getRateLimiter ('login_attempts ' );
@@ -341,7 +341,7 @@ public function resetLoginRateLimit(string $username, string $ip = null): void
341341 * @param string|null $ip
342342 * @return string
343343 */
344- public function getIpKey (string $ ip = null ): string
344+ public function getIpKey (? string $ ip = null ): string
345345 {
346346 if (null === $ ip ) {
347347 $ ip = Uri::ip ();
@@ -520,7 +520,7 @@ public function sendActivationEmail(UserInterface $user)
520520 * @return bool True if the action was performed.
521521 * @throws \RuntimeException
522522 */
523- public function sendInviteEmail (Invitation $ invitation , string $ message = null , UserInterface $ user = null )
523+ public function sendInviteEmail (Invitation $ invitation , ? string $ message = null , ? UserInterface $ user = null )
524524 {
525525 try {
526526 Email::sendInvitationEmail ($ invitation , $ message , $ user );
@@ -623,7 +623,7 @@ public function getRateLimiter($context, $maxCount = null, $interval = null)
623623 * @param PageInterface|null $page
624624 * @return PageInterface|null
625625 */
626- public function getPage (string $ type , string $ route = null , PageInterface $ page = null ): ?PageInterface
626+ public function getPage (string $ type , ? string $ route = null , ? PageInterface $ page = null ): ?PageInterface
627627 {
628628 $ route = $ route ?? $ this ->getRoute ($ type , true );
629629 if (null === $ route ) {
@@ -663,7 +663,7 @@ public function getPage(string $type, string $route = null, PageInterface $page
663663 * @param PageInterface|null $page
664664 * @return PageInterface|null
665665 */
666- public function addPage (string $ type , string $ route = null , PageInterface $ page = null ): ?PageInterface
666+ public function addPage (string $ type , ? string $ route = null , ? PageInterface $ page = null ): ?PageInterface
667667 {
668668 $ page = $ this ->getPage ($ type , $ route , $ page );
669669 if (null === $ page ) {
@@ -685,7 +685,7 @@ public function addPage(string $type, string $route = null, PageInterface $page
685685 * @param bool|null $enabled
686686 * @return string|null Returns route or null if the route has been disabled.
687687 */
688- public function getRoute (string $ type , bool $ enabled = null ): ?string
688+ public function getRoute (string $ type , ? bool $ enabled = null ): ?string
689689 {
690690 switch ($ type ) {
691691 case 'login ' :
@@ -732,7 +732,7 @@ public function getRoute(string $type, bool $enabled = null): ?string
732732 * @param Data|null $config
733733 * @return bool
734734 */
735- public function isUserAuthorizedForPage (UserInterface $ user , PageInterface $ page , Data $ config = null ): bool
735+ public function isUserAuthorizedForPage (UserInterface $ user , PageInterface $ page , ? Data $ config = null ): bool
736736 {
737737 /** @var PageAuthorizeEvent $event */
738738 $ event = $ this ->grav ->dispatchEvent (new PageAuthorizeEvent ($ page , $ user , $ config ));
0 commit comments