PHP Class Browscap\Data\Expander

Author: Thomas Müller ([email protected])
Show file Open project: browscap/browscap Class Usage Examples

Public Methods

Method Description
expand ( Division $division, string $divisionName ) : array
getDataCollection ( ) : DataCollection Get the data collection
getLogger ( ) : Psr\Log\LoggerInterface
getVersionParts ( string $version ) : string[] splits a version into the major and the minor version
parseProperty ( string $value, string $majorVer, string $minorVer ) : string Render the property of a single User Agent
setDataCollection ( DataCollection $collection ) : Expander Set the data collection
setLogger ( Psr\Log\LoggerInterface $logger ) : Expander
trimProperty ( string $propertyValue ) : string | boolean trims the value of a property and converts the string values "true" and "false" to boolean

Private Methods

Method Description
checkEngineData ( array $properties, string $message ) checks if platform properties are set inside a properties array
checkPlatformData ( array $properties, string $message ) checks if platform properties are set inside a properties array
expandProperties ( array $allInputDivisions ) : array expands all properties for all useragents to make sure all properties are set and make it possible to skip incomplete properties and remove duplicate definitions
parseChildren ( string $ua, array $uaDataChild, boolean $lite = true, boolean $standard = true ) : array[] Render the children section in a single User Agent block
parseDivision ( Division $division, string $divisionName ) : array Render a single division
parseUserAgent ( array $uaData, boolean $lite, boolean $standard, integer $sortIndex, string $divisionName ) : array Render a single User Agent block

Method Details

expand() public method

public expand ( Division $division, string $divisionName ) : array
$division Division
$divisionName string
return array

getDataCollection() public method

Get the data collection
public getDataCollection ( ) : DataCollection
return DataCollection

getLogger() public method

public getLogger ( ) : Psr\Log\LoggerInterface
return Psr\Log\LoggerInterface $logger

getVersionParts() public method

splits a version into the major and the minor version
public getVersionParts ( string $version ) : string[]
$version string
return string[]

parseProperty() public method

Render the property of a single User Agent
public parseProperty ( string $value, string $majorVer, string $minorVer ) : string
$value string
$majorVer string
$minorVer string
return string

setDataCollection() public method

Set the data collection
public setDataCollection ( DataCollection $collection ) : Expander
$collection DataCollection
return Expander

setLogger() public method

public setLogger ( Psr\Log\LoggerInterface $logger ) : Expander
$logger Psr\Log\LoggerInterface
return Expander

trimProperty() public method

trims the value of a property and converts the string values "true" and "false" to boolean
public trimProperty ( string $propertyValue ) : string | boolean
$propertyValue string
return string | boolean