Code Duplication    Length = 18-19 lines in 2 locations

main/webservices/access_url.php 1 location

@@ 20-37 (lines=18) @@
17
define('WS_ERROR_INVALID_INPUT', 3);
18
define('WS_ERROR_SETTING', 4);
19
20
function return_error($code) {
21
    $fault = null;
22
    switch ($code) {
23
        case WS_ERROR_SECRET_KEY:
24
            $fault = new soap_fault('Server', '', 'Secret key is not correct or params are not correctly set');
25
            break;
26
        case WS_ERROR_NOT_FOUND_RESULT:
27
            $fault = new soap_fault('Server', '', 'No result was found for this query');
28
            break;
29
        case WS_ERROR_INVALID_INPUT:
30
            $fault = new soap_fault('Server', '', 'The input variables are invalid o are not correctly set');
31
            break;
32
        case WS_ERROR_SETTING:
33
            $fault = new soap_fault('Server', '', 'Please check the configuration for this webservice');
34
            break;
35
    }
36
    return $fault;
37
}
38
39
/**
40
 * @param array $params

main/webservices/registration.soap.php 1 location

@@ 24-42 (lines=19) @@
21
 * @param string $code
22
 * @return null|soap_fault
23
 */
24
function returnError($code)
25
{
26
    $fault = null;
27
    switch ($code) {
28
        case WS_ERROR_SECRET_KEY:
29
            $fault = new soap_fault('Server', '', 'Secret key is not correct or params are not correctly set');
30
            break;
31
        case WS_ERROR_NOT_FOUND_RESULT:
32
            $fault = new soap_fault('Server', '', 'No result was found for this query');
33
            break;
34
        case WS_ERROR_INVALID_INPUT:
35
            $fault = new soap_fault('Server', '', 'The input variables are invalid o are not correctly set');
36
            break;
37
        case WS_ERROR_SETTING:
38
            $fault = new soap_fault('Server', '', 'Please check the configuration for this webservice');
39
            break;
40
    }
41
    return $fault;
42
}
43
44
/**
45
 * @param array $params