public function parseJson($baseWord, $jsonString)
    {
        $decodedResponse = json_decode($jsonString);
        $synonyms = [];
        if (!empty($baseWord)) {
            if (is_array($decodedResponse->{$baseWord})) {
                $synonyms = $decodedResponse->{$baseWord};
            }
        } else {
            if (isset($decodedResponse->synonymMappings->managedMap)) {
                $synonyms = (array)$decodedResponse->synonymMappings->managedMap;
            }
        }

        return $synonyms;
    }
public function parseJson($baseWord, $jsonString)
    {
        $decodedResponse = json_decode($jsonString);
        $synonyms = [];
        if (!empty($baseWord)) {
            if (is_array($decodedResponse->{$baseWord})) {
                $synonyms = $decodedResponse->{$baseWord};
            }
        } else {
            if (isset($decodedResponse->synonymMappings->managedMap)) {
                $synonyms = (array)$decodedResponse->synonymMappings->managedMap;
            }
        }

        return $synonyms;
    }
public function parseJson ( $ baseWord , $ jsonString ) { $ decodedResponse = json_decode ( $ jsonString ) ; $ synonyms = [ ] ; if ( ! empty ( $ baseWord ) ) { if ( is_array ( $ decodedResponse -> { $ baseWord } ) ) { $ synonyms = $ decodedResponse -> { $ baseWord } ; } } else { if ( isset ( $ decodedResponse -> synonymMappings -> managedMap ) ) { $ synonyms = ( array ) $ decodedResponse -> synonymMappings -> managedMap ; } } return $ synonyms ; }
Parse the solr synonyms response from an json string to an array.

@param string $baseWord
@param string $jsonString
@return array
Parse the solr synonyms response from an json string to an array .