Code Duplication    Length = 14-14 lines in 2 locations

src/Surfnet/StepupGateway/SamlStepupProviderBundle/Saml/ProxyResponseFactory.php 1 location

@@ 99-112 (lines=14) @@
96
     * @param SAML2_Assertion $newAssertion
97
     * @param ServiceProvider $targetServiceProvider
98
     */
99
    private function addSubjectConfirmationFor(SAML2_Assertion $newAssertion, ServiceProvider $targetServiceProvider)
100
    {
101
        $confirmation         = new SAML2_XML_saml_SubjectConfirmation();
102
        $confirmation->Method = SAML2_Const::CM_BEARER;
103
104
        $confirmationData                      = new SAML2_XML_saml_SubjectConfirmationData();
105
        $confirmationData->InResponseTo        = $this->stateHandler->getRequestId();
106
        $confirmationData->Recipient           = $targetServiceProvider->getAssertionConsumerUrl();
107
        $confirmationData->NotOnOrAfter        = $this->getTimestamp('PT8H');
108
109
        $confirmation->SubjectConfirmationData = $confirmationData;
110
111
        $newAssertion->setSubjectConfirmation([$confirmation]);
112
    }
113
114
    /**
115
     * @param SAML2_Assertion $newAssertion

src/Surfnet/StepupGateway/GatewayBundle/Service/ProxyResponseService.php 1 location

@@ 128-141 (lines=14) @@
125
     * @param SAML2_Assertion $newAssertion
126
     * @param ServiceProvider $targetServiceProvider
127
     */
128
    private function addSubjectConfirmationFor(SAML2_Assertion $newAssertion, ServiceProvider $targetServiceProvider)
129
    {
130
        $confirmation         = new \SAML2_XML_saml_SubjectConfirmation();
131
        $confirmation->Method = \SAML2_Const::CM_BEARER;
132
133
        $confirmationData                      = new \SAML2_XML_saml_SubjectConfirmationData();
134
        $confirmationData->InResponseTo        = $this->proxyStateHandler->getRequestId();
135
        $confirmationData->Recipient           = $targetServiceProvider->getAssertionConsumerUrl();
136
        $confirmationData->NotOnOrAfter        = $this->getTimestamp('PT8H');
137
138
        $confirmation->SubjectConfirmationData = $confirmationData;
139
140
        $newAssertion->setSubjectConfirmation([$confirmation]);
141
    }
142
143
    /**
144
     * @param SAML2_Assertion $newAssertion