src/FieldType/Base.php
public function getStatsTextData($aResponses)
    {
        $aOut     = [];
        $aStrings = [];

        foreach ($aResponses as $oResponse) {
            if (!empty($oResponse->text)) {
                if (!array_key_exists($oResponse->text, $aStrings)) {
                    $aStrings[$oResponse->text] = 0;
                }
                $aStrings[$oResponse->text]++;
            }
        }

        foreach ($aStrings as $sString => $iCount) {
            if ($iCount > 1) {
                $sString .= ' <span class="count" title="This item repeats ' . $iCount . ' times">' . $iCount . '</span>';
            }
            $aOut[] = $sString;
        }

        return $aOut;
    }
public function getStatsTextData($aResponses)
    {
        $aOut     = [];
        $aStrings = [];

        foreach ($aResponses as $oResponse) {
            if (!empty($oResponse->text)) {
                if (!array_key_exists($oResponse->text, $aStrings)) {
                    $aStrings[$oResponse->text] = 0;
                }
                $aStrings[$oResponse->text]++;
            }
        }

        foreach ($aStrings as $sString => $iCount) {
            if ($iCount > 1) {
                $sString .= ' <span class="count" title="This item repeats ' . $iCount . ' times">' . $iCount . '</span>';
            }
            $aOut[] = $sString;
        }

        return $aOut;
    }
public function getStatsTextData ( $ aResponses ) { $ aOut = [ ] ; $ aStrings = [ ] ; foreach ( $ aResponses as $ oResponse ) { if ( ! empty ( $ oResponse -> text ) ) { if ( ! array_key_exists ( $ oResponse -> text , $ aStrings ) ) { $ aStrings [ $ oResponse -> text ] = 0 ; } $ aStrings [ $ oResponse -> text ] ++ ; } } foreach ( $ aStrings as $ sString => $ iCount ) { if ( $ iCount > 1 ) { $ sString .= ' <span class="count" title="This item repeats ' . $ iCount . ' times">' . $ iCount . '</span>' ; } $ aOut [ ] = $ sString ; } return $ aOut ; }
Takes responses for this field type and extracts all the text components

@param  array $aResponses The array of responses from ResponseAnswer

@return array
Takes responses for this field type and extracts all the text components