PHP Class Scientist\Laboratory

The Laboratory is where the magic takes place. Here we define and conduct our experiments.
ファイルを表示 Open project: daylerees/scientist Class Usage Examples

Protected Properties

Property Type Description
$journals Scientist\Journals\Journal[] Collection of journals to report to.

Public Methods

Method Description
addJournal ( Scientist\Journals\Journal $journal ) Register a new journal.
experiment ( string $name ) : mixed Start a new experiment.
getJournals ( ) : array Retrieve registers journals.
getReport ( Experiment $experiment ) : Report Run an experiment and return the result.
runExperiment ( Experiment $experiment ) : mixed Run an experiment.
setJournals ( array $journals = [] ) Register a collection of journals.

Protected Methods

Method Description
reportToJournals ( Experiment $experiment, Report $report ) : void Report experiment result to registered journals.

Method Details

addJournal() public method

Register a new journal.
public addJournal ( Scientist\Journals\Journal $journal )
$journal Scientist\Journals\Journal

experiment() public method

Start a new experiment.
public experiment ( string $name ) : mixed
$name string
return mixed

getJournals() public method

Retrieve registers journals.
public getJournals ( ) : array
return array

getReport() public method

Run an experiment and return the result.
public getReport ( Experiment $experiment ) : Report
$experiment Experiment
return Report

reportToJournals() protected method

Report experiment result to registered journals.
protected reportToJournals ( Experiment $experiment, Report $report ) : void
$experiment Experiment
$report Report
return void

runExperiment() public method

Run an experiment.
public runExperiment ( Experiment $experiment ) : mixed
$experiment Experiment
return mixed

setJournals() public method

Register a collection of journals.
public setJournals ( array $journals = [] )
$journals array

Property Details

$journals protected_oe property

Collection of journals to report to.
protected Journal[],Scientist\Journals $journals
return Scientist\Journals\Journal[]