PHP Класс PhpBench\Model\ResultCollection

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $results = [] )
getMetric ( string $class, string $metric ) : mixed Return the named metric for the given result class.
getMetricOrDefault ( string $class, string $metric, mixed $default = null ) : mixed Return the named metric or the default value if the *result class* has not been set.
getResult ( string $class ) : PhpBench\Model\ResultInterface Return the result of the given class, throw an exception if it does not exist.
getResults ( ) : PhpBench\Model\ResultInterface[] Return all results.
hasResult ( string $class ) : boolean Return true if there is a result for the given class name.
setResult ( PhpBench\Model\ResultInterface $result ) Add a result to the collection.

Описание методов

__construct() публичный Метод

public __construct ( array $results = [] )
$results array

getMetric() публичный Метод

Return the named metric for the given result class.
public getMetric ( string $class, string $metric ) : mixed
$class string
$metric string
Результат mixed

getMetricOrDefault() публичный Метод

If the metric does not exist but the class *does* exist then there is clearly a problem and we should allow an error to be thrown.
public getMetricOrDefault ( string $class, string $metric, mixed $default = null ) : mixed
$class string
$metric string
$default mixed
Результат mixed

getResult() публичный Метод

Return the result of the given class, throw an exception if it does not exist.
public getResult ( string $class ) : PhpBench\Model\ResultInterface
$class string
Результат PhpBench\Model\ResultInterface

getResults() публичный Метод

Return all results.
public getResults ( ) : PhpBench\Model\ResultInterface[]
Результат PhpBench\Model\ResultInterface[]

hasResult() публичный Метод

Return true if there is a result for the given class name.
public hasResult ( string $class ) : boolean
$class string
Результат boolean

setResult() публичный Метод

Only one result per class is permitted.
public setResult ( PhpBench\Model\ResultInterface $result )
$result PhpBench\Model\ResultInterface