\FACTFinder\CoreParametersConverter

Handles the conversion of parameters between requests to the client and requests to the FACT-Finder server (and vice-versa).

Summary

Methods
Properties
Constants
__construct()
convertClientToServerParameters()
convertServerToClientParameters()
No public properties found
No constants found
applyParameterMappings()
removeIgnoredParameters()
applyWhitelist()
ensureChannelParameter()
addRequiredParameters()
$configuration
N/A
No private methods found
$log
N/A

Properties

$log

$log : \FACTFinder\Core\FACTFinder\Util\LoggerInterface

Type

\FACTFinder\Core\FACTFinder\Util\LoggerInterface

Methods

__construct()

__construct(string  $loggerClass, \FACTFinder\Core\ConfigurationInterface  $configuration) 

Parameters

string $loggerClass

Class name of logger to use. The class should implement FACTFinder\Util\LoggerInterface.

\FACTFinder\Core\ConfigurationInterface $configuration

Configuration object to use.

convertClientToServerParameters()

convertClientToServerParameters(\FACTFinder\Core\Parameters  $clientParameters) : \FACTFinder\Core\Parameters

Parameters

\FACTFinder\Core\Parameters $clientParameters

Parameters obtained from a request to the client.

Returns

\FACTFinder\Core\Parameters —

Parameters ready for use with FACT-Finder.

convertServerToClientParameters()

convertServerToClientParameters(  $serverParameters) : \FACTFinder\Core\Parameters

Parameters

$serverParameters

Returns

\FACTFinder\Core\Parameters —

Parameters ready for use in requests to the client.

applyParameterMappings()

applyParameterMappings(\FACTFinder\Core\Parameters  $parameters, array<mixed,string>  $mappingRules) 

Changes the keys in a Parameters object according to the given mapping rules.

Parameters

\FACTFinder\Core\Parameters $parameters

Parameters to be modified.

array<mixed,string> $mappingRules

Associative array of mapping rules. Parameter names will be mapped from keys to values of this array.

removeIgnoredParameters()

removeIgnoredParameters(\FACTFinder\Core\Parameters  $parameters, array<mixed,boolean>  $ignoreRules) 

Removes keys from a Parameters object according to the given ignore rules. It basically turns the parameters into the set difference of the parameters and the ignore rules based on keys.

Parameters

\FACTFinder\Core\Parameters $parameters

Parameters to be modified.

array<mixed,boolean> $ignoreRules

Array of parameters to be ignored. The keys are the parameter names, the values are simply "true", but could technically have any value.

applyWhitelist()

applyWhitelist(\FACTFinder\Core\type  $parameters, array<mixed,boolean>  $whitelistRules) 

Removes keys from a Parameters object according to the given whitelist rules.

An empty whitelist means do NOT apply any whitelist (anything is allowed). It removes any keys that are not keys in the given whitelist array aswell. If the key of any rule starts with '/' the key is interpreted as a regular expression to be matched against.

Parameters

\FACTFinder\Core\type $parameters
array<mixed,boolean> $whitelistRules

Array of parameters to be allowed. The keys are the parameter names, the values are simply "true", but could technically have any value.

ensureChannelParameter()

ensureChannelParameter(\FACTFinder\Core\Parameters  $parameters) 

Ensures that the passed parameters object has a "channel" parameter by adding one if necessary.

Parameters

\FACTFinder\Core\Parameters $parameters

Parameters to be modifier.

addRequiredParameters()

addRequiredParameters(\FACTFinder\Core\Parameters  $parameters,   $requireRules) 

Adds keys to an array of parameters according to the given require rules.

Parameters

\FACTFinder\Core\Parameters $parameters

Parameters to be modified.

$requireRules