Utility/ReflectionUtil.php
- Package
- Default
\ReflectionUtil
Package: Default


Class ReflectionUtil to convert an array to an WehbooksEvent Object
Methods


assignValue( $object, $key, $value) : void
static
Given the class name, find the setter method for the key.
Parameters
Name | Type | Description |
---|---|---|
$object | The class that contains the setter method | |
$key | The name of the setter | |
$value | The value to be assigned to the setter |


constructObjectFromWebhooksArray( $array, $arrayContainerClassName) : null
static
Pre-assumption: the input array must be a map at the beginning, no matter it is at beginning or at a recursive call. Otherwise, the reflection class won't know what the object name is for the list.
Parameters
Returns
Name | Type | Description |
---|---|---|
$array | The object in array format | |
$arrayContainerClassName | The class that contains the array |
Type | Description |
---|---|
null |


isValidWebhooksClass( $className, null $classCollection = null) : null | string
static
When given a WehbooksService name, check if the given class name is defined on the WehbooksService directory
Parameters
Returns
Name | Type | Description |
---|---|---|
$className | The object name that belongs to WebhooksService | |
$classCollection | null | Default to be null. User can choose to pass their own collection |
Type | Description |
---|---|
null | string | If the class name can be found in Webhooks Service, return the name; otherwise, return null. |