PHP Class Rating\Rating

Show file Open project: chovanec/elo-rating

Protected Properties

Property Type Description
$_expectedA
$_expectedB
$_newRatingA
$_newRatingB
$_ratingA Protected & private variables.
$_ratingB
$_scoreA
$_scoreB

Public Methods

Method Description
__construct ( $ratingA, $ratingB, $scoreA, $scoreB ) Costructor function which does all the maths and stores the results ready for retrieval.
getNewRatings ( ) : Array Retrieve the calculated data.
setNewSettings ( $ratingA, $ratingB, $scoreA, $scoreB ) Set new input data.

Protected Methods

Method Description
_getExpectedScores ( $ratingA, $ratingB ) Protected & private functions begin here
_getNewRatings ( $ratingA, $ratingB, $expectedA, $expectedB, $scoreA, $scoreB )

Method Details

__construct() public method

Costructor function which does all the maths and stores the results ready for retrieval.
public __construct ( $ratingA, $ratingB, $scoreA, $scoreB )

_getExpectedScores() protected method

Protected & private functions begin here
protected _getExpectedScores ( $ratingA, $ratingB )

_getNewRatings() protected method

protected _getNewRatings ( $ratingA, $ratingB, $expectedA, $expectedB, $scoreA, $scoreB )

getNewRatings() public method

Retrieve the calculated data.
public getNewRatings ( ) : Array
return Array An array containing the new ratings for A and B.

setNewSettings() public method

Set new input data.
public setNewSettings ( $ratingA, $ratingB, $scoreA, $scoreB )

Property Details

$_expectedA protected property

protected $_expectedA

$_expectedB protected property

protected $_expectedB

$_newRatingA protected property

protected $_newRatingA

$_newRatingB protected property

protected $_newRatingB

$_ratingA protected property

Protected & private variables.
protected $_ratingA

$_ratingB protected property

protected $_ratingB

$_scoreA protected property

protected $_scoreA

$_scoreB protected property

protected $_scoreB