Utility/MetadataExtractor.php
- Package
- Default
\Intuit\Ipp\Utility\MetadataExtractor
Package: DefaultExtracts metadata for properties and decides which type is associated with this property
- Author
- amatiushkin
Constants


REGULAR_GET_VAR
= "/@var\s+(.*)/"Methods



completeProperty(\Intuit\Ipp\Utility\Serialization\AbstractEntity $a, \ReflectionProperty $p) : voidFinilizes created metadata description with few more info
Parameters| Name | Type | Description |
|---|
| $a | \Intuit\Ipp\Utility\Serialization\AbstractEntity | |
|---|
| $p | \ReflectionProperty | |
|---|
Throws| Exception | Description |
|---|
| \InvalidArgumentException | |



extractVarValueFromComment(\Intuit\Ipp\Utility\type $text) : voidReturns value of @var from text. It also returns last part (class name) of path-like value
TODO Move this function into separate object outside of this class.
Domain Entity builder doesn't care about how values are parsed.
It's better to apply dependecy-injection pattern here.
The only reason this function is here is for initial implementation.
Parameters| Name | Type | Description |
|---|
| $text | \Intuit\Ipp\Utility\type | |
|---|



generateObjectNames(\Intuit\Ipp\Utility\type $value) : \Intuit\Ipp\Utility\typeReturns order list of possible valid names of object type
Parameters| Name | Type | Description |
|---|
| $value | \Intuit\Ipp\Utility\type | |
|---|
Returns| Type | Description |
|---|
| \Intuit\Ipp\Utility\type | |



getClassNameFromPackagePath(string $string) : stringReturns last part from package-like names (e.g. my\package\MyClass).
Expected result is MyClass
Parameters| Name | Type | Description |
|---|
| $string | string | |
|---|
Returns


getIntuitName(\Intuit\Ipp\Utility\type $string) : \Intuit\Ipp\Utility\typeReturns class name with prefix
TODO Move it out from this object and make this class generic
Parameters| Name | Type | Description |
|---|
| $string | \Intuit\Ipp\Utility\type | |
|---|
Returns| Type | Description |
|---|
| \Intuit\Ipp\Utility\type | |



removeArrayBrackets(string $string) : stringRemoves brackets from comments. In other words
it cleans up collection-like definitions (e.g. MyCollectionOfType[])
Parameters| Name | Type | Description |
|---|
| $string | string | |
|---|
Returns 


verifyVariableType(\Intuit\Ipp\Utility\type $value) : \Intuit\Ipp\Utility\Serialization\AbstractEntityVerifies type and creates entity object
Parameters| Name | Type | Description |
|---|
| $value | \Intuit\Ipp\Utility\type | |
|---|
Returns| Type | Description |
|---|
| \Intuit\Ipp\Utility\Serialization\AbstractEntity | |