PHP Class Opensoft\Rollout\Feature

Author: Richard Fullmer ([email protected])
Show file Open project: opensoft/rollout Class Usage Examples

Public Methods

Method Description
__construct ( string $name, string | null $settings = null )
addGroup ( string $group )
addUser ( RolloutUserInterface $user )
clear ( ) Clear the feature of all configuration
getGroups ( ) : array
getName ( ) : string
getPercentage ( ) : integer
getRequestParam ( ) : string | null
getUsers ( ) : array
isActive ( Rollout $rollout, RolloutUserInterface $user = null, array $requestParameters = [] ) : boolean Is the feature active?
removeGroup ( string $group )
removeUser ( RolloutUserInterface $user )
serialize ( ) : string
setPercentage ( integer $percentage )
setRequestParam ( string | null $requestParam )
toArray ( ) : array

Private Methods

Method Description
isParamInRequestParams ( array $requestParameters ) : boolean
isUserInActiveGroup ( RolloutUserInterface $user, Rollout $rollout ) : boolean
isUserInActiveUsers ( RolloutUserInterface $user ) : boolean
isUserInPercentage ( RolloutUserInterface $user ) : boolean

Method Details

__construct() public method

public __construct ( string $name, string | null $settings = null )
$name string
$settings string | null

addGroup() public method

public addGroup ( string $group )
$group string

addUser() public method

public addUser ( RolloutUserInterface $user )
$user RolloutUserInterface

clear() public method

Clear the feature of all configuration
public clear ( )

getGroups() public method

public getGroups ( ) : array
return array

getName() public method

public getName ( ) : string
return string

getPercentage() public method

public getPercentage ( ) : integer
return integer

getRequestParam() public method

public getRequestParam ( ) : string | null
return string | null

getUsers() public method

public getUsers ( ) : array
return array

isActive() public method

Is the feature active?
public isActive ( Rollout $rollout, RolloutUserInterface $user = null, array $requestParameters = [] ) : boolean
$rollout Rollout
$user RolloutUserInterface
$requestParameters array
return boolean

removeGroup() public method

public removeGroup ( string $group )
$group string

removeUser() public method

public removeUser ( RolloutUserInterface $user )
$user RolloutUserInterface

serialize() public method

public serialize ( ) : string
return string

setPercentage() public method

public setPercentage ( integer $percentage )
$percentage integer

setRequestParam() public method

public setRequestParam ( string | null $requestParam )
$requestParam string | null

toArray() public method

public toArray ( ) : array
return array