class IPRangesCsvWriter (View source)

Properties

protected Writer $writer

The writer we use to output.

protected int $type

One of the IPService::IPRANGETYPE_... constants.

protected Date $dateHelper

The date localization service.

Methods

__construct(Writer $writer, int $type, Date $dateHelper)

No description

insertHeaders()

Insert a header row for this result set.

insertRanges(IPRange[]|Generator $ranges)

Insert a list of IPRange instances.

insertRange(IPRange $range)

Insert an IPRange instance.

array[]|Generator
projectRanges($ranges)

A generator that takes a collection of IPRange ranges and converts it to CSV rows.

string[]
projectRange(IPRange $range)

Turn an IPRange instance into an array.

string[]
getHeaders()

Get the headers of the CSV.

Details

__construct(Writer $writer, int $type, Date $dateHelper)

No description

Parameters

Writer $writer

the writer we use to output

int $type

One of the IPService::IPRANGETYPE_... constants

Date $dateHelper

the Date localization service

insertHeaders()

Insert a header row for this result set.

insertRanges(IPRange[]|Generator $ranges)

Insert a list of IPRange instances.

Parameters

IPRange[]|Generator $ranges

insertRange(IPRange $range)

Insert an IPRange instance.

Parameters

IPRange $range

private array[]|Generator projectRanges($ranges)

A generator that takes a collection of IPRange ranges and converts it to CSV rows.

Parameters

$ranges

Return Value

array[]|Generator

private string[] projectRange(IPRange $range)

Turn an IPRange instance into an array.

Parameters

IPRange $range

Return Value

string[]

private string[] getHeaders()

Get the headers of the CSV.

Return Value

string[]