@@ 7-19 (lines=13) @@ | ||
4 | ||
5 | use AlgoWeb\ODataMetadata\xsdRestrictions; |
|
6 | ||
7 | trait TFunctionTypeTrait |
|
8 | { |
|
9 | use TQualifiedNameTrait, xsdRestrictions; |
|
10 | ||
11 | public function isTFunctionTypeValid($string) |
|
12 | { |
|
13 | if (!$this->isTQualifiedNameValid($string)) { |
|
14 | return false; |
|
15 | } |
|
16 | $regex = 'Collection\([^ \t]{1,}(\.[^ \t]{1,}){0,}\)'; |
|
17 | return $this->matchesRegexPattern($regex, $string); |
|
18 | } |
|
19 | } |
@@ 13-25 (lines=13) @@ | ||
10 | ||
11 | use AlgoWeb\ODataMetadata\xsdRestrictions; |
|
12 | ||
13 | trait TPropertyTypeTrait |
|
14 | { |
|
15 | use TQualifiedNameTrait, xsdRestrictions; |
|
16 | public function isTPropertyTypeValid($string) |
|
17 | { |
|
18 | if (!$this->isTQualifiedNameValid($string)) { |
|
19 | return false; |
|
20 | } |
|
21 | // The below pattern represents the allowed identifiers in ECMA specification plus the '.' for namespace qualificatio |
|
22 | $regex = '[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}(\.[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}){0,}'; |
|
23 | return $this->matchesRegexPattern($regex, $string); |
|
24 | } |
|
25 | } |
|
26 |