Dingo\Api\Exception\Handler::recursivelyRemoveEmptyReplacements PHP Method

recursivelyRemoveEmptyReplacements() protected method

Recursirvely remove any empty replacement values in the response array.
protected recursivelyRemoveEmptyReplacements ( array $input ) : array
$input array
return array
    protected function recursivelyRemoveEmptyReplacements(array $input)
    {
        foreach ($input as &$value) {
            if (is_array($value)) {
                $value = $this->recursivelyRemoveEmptyReplacements($value);
            }
        }
        return array_filter($input, function ($value) {
            if (is_string($value)) {
                return !starts_with($value, ':');
            }
            return true;
        });
    }