src/FlexiPeeHP/FlexiBeeRO.php
public function unifyResponseFormat($responseBody)
    {
        if (!is_array($responseBody) || array_key_exists('message',
                $responseBody)) { //Unifi response format
            $response = $responseBody;
        } else {
            $evidence = $this->getResponseEvidence();
            if (array_key_exists($evidence, $responseBody)) {
                $response        = [];
                $evidenceContent = $responseBody[$evidence];
                if (array_key_exists(0, $evidenceContent)) {
                    $response[$evidence] = $evidenceContent; //Multiplete Results
                } else {
                    $response[$evidence][0] = $evidenceContent; //One result
                }
            } else {
                if (isset($responseBody['priloha'])) {
                    $response = $responseBody['priloha'];
                } else {
                    if (array_key_exists('results', $responseBody)) {
                        $response = $responseBody['results'];
                    } else {
                        $response = $responseBody;
                    }
                }
            }
        }
        return $response;
    }
public function unifyResponseFormat($responseBody)
    {
        if (!is_array($responseBody) || array_key_exists('message',
                $responseBody)) { //Unifi response format
            $response = $responseBody;
        } else {
            $evidence = $this->getResponseEvidence();
            if (array_key_exists($evidence, $responseBody)) {
                $response        = [];
                $evidenceContent = $responseBody[$evidence];
                if (array_key_exists(0, $evidenceContent)) {
                    $response[$evidence] = $evidenceContent; //Multiplete Results
                } else {
                    $response[$evidence][0] = $evidenceContent; //One result
                }
            } else {
                if (isset($responseBody['priloha'])) {
                    $response = $responseBody['priloha'];
                } else {
                    if (array_key_exists('results', $responseBody)) {
                        $response = $responseBody['results'];
                    } else {
                        $response = $responseBody;
                    }
                }
            }
        }
        return $response;
    }
public function unifyResponseFormat ( $ responseBody ) { if ( ! is_array ( $ responseBody ) || array_key_exists ( 'message' , $ responseBody ) ) { //Unifi response format $ response = $ responseBody ; } else { $ evidence = $ this -> getResponseEvidence ( ) ; if ( array_key_exists ( $ evidence , $ responseBody ) ) { $ response = [ ] ; $ evidenceContent = $ responseBody [ $ evidence ] ; if ( array_key_exists ( 0 , $ evidenceContent ) ) { $ response [ $ evidence ] = $ evidenceContent ; //Multiplete Results } else { $ response [ $ evidence ] [ 0 ] = $ evidenceContent ; //One result } } else { if ( isset ( $ responseBody [ 'priloha' ] ) ) { $ response = $ responseBody [ 'priloha' ] ; } else { if ( array_key_exists ( 'results' , $ responseBody ) ) { $ response = $ responseBody [ 'results' ] ; } else { $ response = $ responseBody ; } } } } return $ response ; }
Return the same response format for one and multiplete results

@param array $responseBody

@return array
Return the same response format for one and multiplete results