| @@ 7-23 (lines=17) @@ | ||
| 4 | ||
| 5 | use AlgoWeb\ODataMetadata\xsdRestrictions; |
|
| 6 | ||
| 7 | trait TUnwrappedFunctionTypeTrait |
|
| 8 | { |
|
| 9 | use TQualifiedNameTrait, xsdRestrictions; |
|
| 10 | ||
| 11 | public function isTUnwrappedFunctionTypeValid($string) |
|
| 12 | { |
|
| 13 | $regex = '[^ \t]{1,}(\.[^ \t]{1,}){0,}'; |
|
| 14 | ||
| 15 | if (!is_string($string)) { |
|
| 16 | throw new \InvalidArgumentException("Input must be a string"); |
|
| 17 | } |
|
| 18 | if ($this->isTQualifiedNameValid($string)) { |
|
| 19 | return true; |
|
| 20 | } |
|
| 21 | return $this->matchesRegexPattern($regex, $string); |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||
| @@ 7-23 (lines=17) @@ | ||
| 4 | ||
| 5 | use AlgoWeb\ODataMetadata\xsdRestrictions; |
|
| 6 | ||
| 7 | trait TWrappedFunctionTypeTrait |
|
| 8 | { |
|
| 9 | use TQualifiedNameTrait, xsdRestrictions; |
|
| 10 | ||
| 11 | public function isTWrappedFunctionTypeValid($string) |
|
| 12 | { |
|
| 13 | $regex = '(Collection|Ref)\([^ \t]{1,}(\.[^ \t]{1,}){0,}\)'; |
|
| 14 | ||
| 15 | if (!is_string($string)) { |
|
| 16 | throw new \InvalidArgumentException("Input must be a string"); |
|
| 17 | } |
|
| 18 | if ($this->isTQualifiedNameValid($string)) { |
|
| 19 | return true; |
|
| 20 | } |
|
| 21 | return $this->matchesRegexPattern($regex, $string); |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||