Utility/MetadataExtractor.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
Package
Default  

\Intuit\Ipp\Utility\MetadataExtractor

Package: Default
Extracts metadata for properties and decides which type is associated with this property
Author
amatiushkin  

Constants

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

Methods

methodprivatecompleteProperty(\Intuit\Ipp\Utility\Serialization\AbstractEntity $a, \ReflectionProperty $p) : void

Finilizes created metadata description with few more info

Parameters
NameTypeDescription
$a\Intuit\Ipp\Utility\Serialization\AbstractEntity
$p\ReflectionProperty
Throws
ExceptionDescription
\InvalidArgumentException
methodprivateextractVarValueFromComment(\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.
Parameters
NameTypeDescription
$text\Intuit\Ipp\Utility\type
methodprivategenerateObjectNames(\Intuit\Ipp\Utility\type $value) : \Intuit\Ipp\Utility\type

Returns order list of possible valid names of object type

Parameters
NameTypeDescription
$value\Intuit\Ipp\Utility\type
Returns
TypeDescription
\Intuit\Ipp\Utility\type
methodprivategetClassNameFromPackagePath(string $string) : string

Returns last part from package-like names (e.g. my\package\MyClass).

Expected result is MyClass
Parameters
NameTypeDescription
$stringstring
Returns
TypeDescription
string
methodprivategetIntuitName(\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

Parameters
NameTypeDescription
$string\Intuit\Ipp\Utility\type
Returns
TypeDescription
\Intuit\Ipp\Utility\type
methodpublicprocessComments( $properties) : void

Parameters
NameTypeDescription
$properties
methodprivateremoveArrayBrackets(string $string) : string

Removes brackets from comments. In other words it cleans up collection-like definitions (e.g. MyCollectionOfType[])

Parameters
NameTypeDescription
$stringstring
Returns
TypeDescription
string
methodprivateverifyVariableType(\Intuit\Ipp\Utility\type $value) : \Intuit\Ipp\Utility\Serialization\AbstractEntity

Verifies type and creates entity object

Parameters
NameTypeDescription
$value\Intuit\Ipp\Utility\type
Returns
TypeDescription
\Intuit\Ipp\Utility\Serialization\AbstractEntity
Documentation was generated by phpDocumentor 2.8.5.