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) : void
Finilizes created metadata description with few more info
ParametersName | Type | Description |
---|
$a | \Intuit\Ipp\Utility\Serialization\AbstractEntity | |
---|
$p | \ReflectionProperty | |
---|
ThrowsException | Description |
---|
\InvalidArgumentException | |



extractVarValueFromComment(\Intuit\Ipp\Utility\type $text) : void
Returns 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.
ParametersName | Type | Description |
---|
$text | \Intuit\Ipp\Utility\type | |
---|



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



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


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



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


verifyVariableType(\Intuit\Ipp\Utility\type $value) : \Intuit\Ipp\Utility\Serialization\AbstractEntity
Verifies type and creates entity object
ParametersName | Type | Description |
---|
$value | \Intuit\Ipp\Utility\type | |
---|
ReturnsType | Description |
---|
\Intuit\Ipp\Utility\Serialization\AbstractEntity | |