Code Duplication    Length = 15-17 lines in 2 locations

src/Security/Security.php 2 locations

@@ 864-880 (lines=17) @@
861
     *
862
     * @return string Returns the "lost password" page as HTML code.
863
     */
864
    public function lostpassword()
865
    {
866
        $handlers = [];
867
        $authenticators = $this->getApplicableAuthenticators(Authenticator::RESET_PASSWORD);
868
        /** @var Authenticator $authenticator */
869
        foreach ($authenticators as $authenticator) {
870
            $handlers[] = $authenticator->getLostPasswordHandler(
871
                Controller::join_links($this->Link(), 'lostpassword')
872
            );
873
        }
874
875
        return $this->delegateToMultipleHandlers(
876
            $handlers,
877
            _t('SilverStripe\\Security\\Security.LOSTPASSWORDHEADER', 'Lost Password'),
878
            $this->getTemplatesFor('lostpassword')
879
        );
880
    }
881
882
    /**
883
     * Show the "change password" page.
@@ 894-908 (lines=15) @@
891
     *
892
     * @return string|HTTPRequest Returns the "change password" page as HTML code, or a redirect response
893
     */
894
    public function changepassword()
895
    {
896
        /** @var array|Authenticator[] $authenticators */
897
        $authenticators = $this->getApplicableAuthenticators(Authenticator::CHANGE_PASSWORD);
898
        $handlers = [];
899
        foreach ($authenticators as $authenticator) {
900
            $handlers[] = $authenticator->getChangePasswordHandler($this->Link('changepassword'));
901
        }
902
903
        return $this->delegateToMultipleHandlers(
904
            $handlers,
905
            _t('SilverStripe\\Security\\Security.CHANGEPASSWORDHEADER', 'Change your password'),
906
            $this->getTemplatesFor('changepassword')
907
        );
908
    }
909
910
    /**
911
     * Create a link to the password reset form.