Adamgoose\Routing\Annotations\EndpointTrait::implodeArray PHP Method

implodeArray() protected method

Implode the given list into a comma separated string.
protected implodeArray ( array $array ) : string
$array array
return string
    protected function implodeArray(array $array)
    {
        $results = [];
        foreach ($array as $key => $value) {
            if (is_string($key)) {
                $results[] = "'" . $key . "' => '" . $value . "'";
            } else {
                $results[] = "'" . $value . "'";
            }
        }
        return count($results) > 0 ? implode(', ', $results) : '';
    }