DigestMD5::createResponse()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 8
ccs 0
cts 4
cp 0
crap 6
rs 9.4285
c 1
b 1
f 0
1
<?php
2
/**
3
 * Nucleus - XMPP Library for PHP
4
 *
5
 * Copyright (C) 2016, Some rights reserved.
6
 *
7
 * @author Kacper "Kadet" Donat <[email protected]>
8
 *
9
 * Contact with author:
10
 * Xmpp: [email protected]
11
 * E-mail: [email protected]
12
 *
13
 * From Kadet with love.
14
 */
15
16
namespace Kadet\Xmpp\Sasl;
17
18
19
class DigestMD5 extends \Fabiang\Sasl\Authentication\DigestMD5
20
{
21
    /**
22
     * Provides the (main) client response for DIGEST-MD5
23
     * requires a few extra parameters than the other
24
     * mechanisms, which are unavoidable.
25
     *
26
     * @param  string $challenge The digest challenge sent by the server
27
     * @return string            The digest response (NOT base64 encoded)
28
     */
29
    public function createResponse($challenge = null)
30
    {
31
        if(strpos($challenge, 'rspauth=') !== false) {
32
            return '';
33
        }
34
35
        return parent::createResponse($challenge);
36
    }
37
38
}