Code Duplication    Length = 14-14 lines in 4 locations

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

@@ 108-121 (lines=14) @@
105
     * @param Assertion $newAssertion
106
     * @param string $destination
107
     */
108
    private function addSubjectConfirmationFor(Assertion $newAssertion, $destination)
109
    {
110
        $confirmation         = new SubjectConfirmation();
111
        $confirmation->Method = Constants::CM_BEARER;
112
113
        $confirmationData                      = new SubjectConfirmationData();
114
        $confirmationData->InResponseTo        = $this->stateHandler->getRequestId();
115
        $confirmationData->Recipient           = $destination;
116
        $confirmationData->NotOnOrAfter        = $newAssertion->getNotOnOrAfter();
117
118
        $confirmation->SubjectConfirmationData = $confirmationData;
119
120
        $newAssertion->setSubjectConfirmation([$confirmation]);
121
    }
122
123
    /**
124
     * @param Assertion $newAssertion

src/Surfnet/StepupGateway/SecondFactorOnlyBundle/Saml/ResponseFactory.php 1 location

@@ 130-143 (lines=14) @@
127
     * @param Assertion $newAssertion
128
     * @param string $destination The ACS location
129
     */
130
    private function addSubjectConfirmationFor(Assertion $newAssertion, $destination)
131
    {
132
        $confirmation         = new SubjectConfirmation();
133
        $confirmation->Method = Constants::CM_BEARER;
134
135
        $confirmationData                      = new SubjectConfirmationData();
136
        $confirmationData->InResponseTo        = $this->proxyStateHandler->getRequestId();
137
        $confirmationData->Recipient           = $destination;
138
        $confirmationData->NotOnOrAfter        = $newAssertion->getNotOnOrAfter();
139
140
        $confirmation->SubjectConfirmationData = $confirmationData;
141
142
        $newAssertion->setSubjectConfirmation([$confirmation]);
143
    }
144
145
    /**
146
     * @param Assertion $assertion

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

@@ 142-155 (lines=14) @@
139
     * @param Assertion $newAssertion
140
     * @param string $destination ACS URL
141
     */
142
    private function addSubjectConfirmationFor(Assertion $newAssertion, $destination)
143
    {
144
        $confirmation         = new SubjectConfirmation();
145
        $confirmation->Method = Constants::CM_BEARER;
146
147
        $confirmationData                      = new SubjectConfirmationData();
148
        $confirmationData->InResponseTo        = $this->proxyStateHandler->getRequestId();
149
        $confirmationData->Recipient           = $destination;
150
        $confirmationData->NotOnOrAfter        = $newAssertion->getNotOnOrAfter();
151
152
        $confirmation->SubjectConfirmationData = $confirmationData;
153
154
        $newAssertion->setSubjectConfirmation([$confirmation]);
155
    }
156
157
    /**
158
     * @param Assertion $newAssertion

tests/src/Controller/IdentityProviderController.php 1 location

@@ 197-210 (lines=14) @@
194
        return $assertion;
195
    }
196
197
    private function addSubjectConfirmationFor(Assertion $newAssertion, $destination, $requestId)
198
    {
199
        $confirmation = new SubjectConfirmation();
200
        $confirmation->Method = Constants::CM_BEARER;
201
202
        $confirmationData                      = new SubjectConfirmationData();
203
        $confirmationData->InResponseTo        = $requestId;
204
        $confirmationData->Recipient           = $destination;
205
        $confirmationData->NotOnOrAfter        = $newAssertion->getNotOnOrAfter();
206
207
        $confirmation->SubjectConfirmationData = $confirmationData;
208
209
        $newAssertion->setSubjectConfirmation([$confirmation]);
210
    }
211
212
    /**
213
     * @return XMLSecurityKey