PropertiesCollector
in package
Collects the properties from the components detected by the ComponentDetectorClass.
Tags
Table of Contents
Properties
- $componentTypes : mixed
- $dynamicPropertiesExtractor : mixed
- $initialPropertiesCapacity : mixed
- $maxComponentTypeSize : mixed
- $maxStockChildLevel : mixed
- $propertyDataTypes : mixed
- $propertyNames : mixed
Methods
- __construct() : mixed
- collectProperties() : mixed
- Collect all the properties including dynamic properties using the passed in array of components that were found from the identifiers.
- addProperties() : mixed
- findComponentForLevel() : Component|null
- If the current component is not set then try and find a replacement "stock" child component. A stock component is the default child component for a parent component. An example might be a device specific operating system under a device component.
- refineChildSpecificComponent() : mixed
- Try and refine a component to a more specific instance.
- refineVersionSpecificComponent() : mixed
- Runs a version search if the component has version-specific children and the properties already collected contains the version property.
Properties
$componentTypes
private
mixed
$componentTypes
= []
$dynamicPropertiesExtractor
private
mixed
$dynamicPropertiesExtractor
$initialPropertiesCapacity
private
mixed
$initialPropertiesCapacity
$maxComponentTypeSize
private
mixed
$maxComponentTypeSize
$maxStockChildLevel
private
mixed
$maxStockChildLevel
$propertyDataTypes
private
mixed
$propertyDataTypes
$propertyNames
private
mixed
$propertyNames
Methods
__construct()
public
__construct(mixed $deviceData, mixed $dynamicPropertiesExtractor) : mixed
Parameters
- $deviceData : mixed
- $dynamicPropertiesExtractor : mixed
collectProperties()
Collect all the properties including dynamic properties using the passed in array of components that were found from the identifiers.
public
collectProperties(mixed $result[, mixed $dynamicProperties = [] ]) : mixed
Parameters
- $result : mixed
- $dynamicProperties : mixed = []
addProperties()
private
addProperties(mixed $properties, mixed $component, mixed $addParentProperties) : mixed
Parameters
- $properties : mixed
- $component : mixed
- $addParentProperties : mixed
findComponentForLevel()
If the current component is not set then try and find a replacement "stock" child component. A stock component is the default child component for a parent component. An example might be a device specific operating system under a device component.
private
findComponentForLevel(mixed $stockChild, mixed $currLevel) : Component|null
In some situations, if the component from the previous level was not found or is a component not directly connected to the device then the passed stockChild might actually be from a higher level. If this is the case, it is necessary to check if the stock child itself has a stock child of the correct level.
Parameters
- $stockChild : mixed
- $currLevel : mixed
Return values
Component|null —A stock child component or null if none found
refineChildSpecificComponent()
Try and refine a component to a more specific instance.
private
refineChildSpecificComponent(mixed $prevLevelComponent, mixed $component) : mixed
A more specific instance of a component is one that is a child of a previous component level. For example,
Previous level: Device (HTC One) | Specific child: Android ------ this may contain properties specific to the HTC One device
During the token trie walk a more generic form of Android might be found that does not have the device specific properties. It can be swapped out for the more specific Android instance by checking the previous component's children.
Parameters
- $prevLevelComponent : mixed
- $component : mixed
refineVersionSpecificComponent()
Runs a version search if the component has version-specific children and the properties already collected contains the version property.
private
refineVersionSpecificComponent(mixed $component, mixed $dynamicProperties) : mixed
Parameters
- $component : mixed
- $dynamicProperties : mixed