@@ -11,12 +11,12 @@ |
||
11 | 11 | |
12 | 12 | abstract class EdmBase extends DomBase |
13 | 13 | { |
14 | - protected function completelyMatchesPattern($str, $pattern){ |
|
14 | + protected function completelyMatchesPattern($str, $pattern) { |
|
15 | 15 | return preg_match($pattern, $str, $matches) === 1 && $matches[0] === $str; |
16 | 16 | } |
17 | 17 | |
18 | - protected function elementToNamedArray (array $raw){ |
|
19 | - return array_reduce($raw, function($carry, $item) { |
|
18 | + protected function elementToNamedArray(array $raw) { |
|
19 | + return array_reduce($raw, function ($carry, $item) { |
|
20 | 20 | |
21 | 21 | if (!method_exists($item, 'getName')) { |
22 | 22 | throw new \InvalidArgumentException('attempted to a none named element to a named array'); |
@@ -11,11 +11,13 @@ |
||
11 | 11 | |
12 | 12 | abstract class EdmBase extends DomBase |
13 | 13 | { |
14 | - protected function completelyMatchesPattern($str, $pattern){ |
|
14 | + protected function completelyMatchesPattern($str, $pattern) |
|
15 | + { |
|
15 | 16 | return preg_match($pattern, $str, $matches) === 1 && $matches[0] === $str; |
16 | 17 | } |
17 | 18 | |
18 | - protected function elementToNamedArray (array $raw){ |
|
19 | + protected function elementToNamedArray (array $raw) |
|
20 | + { |
|
19 | 21 | return array_reduce($raw, function($carry, $item) { |
20 | 22 | |
21 | 23 | if (!method_exists($item, 'getName')) { |
@@ -96,8 +96,7 @@ |
||
96 | 96 | new AttributeContainer('Type', $this->getType()->getName()) |
97 | 97 | ]; |
98 | 98 | return $this->getType() instanceof IScalarType ? |
99 | - array_merge($this->getAttributesHasFacets(),$baseAttribute) : |
|
100 | - $baseAttribute; |
|
99 | + array_merge($this->getAttributesHasFacets(), $baseAttribute) : $baseAttribute; |
|
101 | 100 | } |
102 | 101 | |
103 | 102 | /** |
@@ -60,7 +60,7 @@ |
||
60 | 60 | |
61 | 61 | public function offsetExists($offset): bool |
62 | 62 | { |
63 | - return array_key_exists($offset,$this->propertyTypes); |
|
63 | + return array_key_exists($offset, $this->propertyTypes); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function offsetGet($offset): Property |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | public function getAttributes(): array |
87 | 87 | { |
88 | 88 | $containerFor = $this->getContainerFor(); |
89 | - if( |
|
89 | + if ( |
|
90 | 90 | $containerFor instanceof IStructuralTypes |
91 | - ){ |
|
91 | + ) { |
|
92 | 92 | return []; |
93 | 93 | } |
94 | 94 | |
@@ -96,8 +96,7 @@ discard block |
||
96 | 96 | new AttributeContainer('Type', strval($containerFor)) |
97 | 97 | ]; |
98 | 98 | return $containerFor instanceof IScalarType ? |
99 | - array_merge($this->getAttributesHasFacets(),$baseAttribute) : |
|
100 | - $baseAttribute; |
|
99 | + array_merge($this->getAttributesHasFacets(), $baseAttribute) : $baseAttribute; |
|
101 | 100 | } |
102 | 101 | |
103 | 102 | /** |
@@ -106,12 +105,12 @@ discard block |
||
106 | 105 | public function getChildElements(): array |
107 | 106 | { |
108 | 107 | $containerFor = $this->getContainerFor(); |
109 | - if( |
|
108 | + if ( |
|
110 | 109 | $containerFor instanceof CollectionType || |
111 | 110 | $containerFor instanceof ReferenceType || |
112 | 111 | $containerFor instanceof RowType || |
113 | 112 | $containerFor instanceof TypeRef |
114 | - ){ |
|
113 | + ) { |
|
115 | 114 | return [$this->containerFor]; |
116 | 115 | } |
117 | 116 | return []; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $containerFor = $this->getContainerFor(); |
89 | 89 | if( |
90 | 90 | $containerFor instanceof IStructuralTypes |
91 | - ){ |
|
91 | + ) { |
|
92 | 92 | return []; |
93 | 93 | } |
94 | 94 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $containerFor instanceof ReferenceType || |
112 | 112 | $containerFor instanceof RowType || |
113 | 113 | $containerFor instanceof TypeRef |
114 | - ){ |
|
114 | + ) { |
|
115 | 115 | return [$this->containerFor]; |
116 | 116 | } |
117 | 117 | return []; |
@@ -103,7 +103,7 @@ |
||
103 | 103 | public function getAttributes(): array |
104 | 104 | { |
105 | 105 | return array_merge( |
106 | - [new AttributeContainer('Name', $this->getName(),true)], |
|
106 | + [new AttributeContainer('Name', $this->getName(), true)], |
|
107 | 107 | $this->getAttributesHasType() |
108 | 108 | ); |
109 | 109 | } |
@@ -46,8 +46,8 @@ |
||
46 | 46 | { |
47 | 47 | if (null !== $value) { |
48 | 48 | $hexPattern = '[a-fA-F0-9]'; |
49 | - $guidPattern = sprintf('/%1$s{8}-%1$s{4}-%1$s{4}-%1$s{4}-%1$s{12}/m',$hexPattern); |
|
50 | - if(!$this->completelyMatchesPattern($value,$guidPattern)){ |
|
49 | + $guidPattern = sprintf('/%1$s{8}-%1$s{4}-%1$s{4}-%1$s{4}-%1$s{12}/m', $hexPattern); |
|
50 | + if (!$this->completelyMatchesPattern($value, $guidPattern)) { |
|
51 | 51 | throw new InvalidArgumentException( |
52 | 52 | sprintf("%s Should be assigned strings matching %s", __CLASS__, $guidPattern) |
53 | 53 | ); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | if (null !== $value) { |
48 | 48 | $hexPattern = '[a-fA-F0-9]'; |
49 | 49 | $guidPattern = sprintf('/%1$s{8}-%1$s{4}-%1$s{4}-%1$s{4}-%1$s{12}/m',$hexPattern); |
50 | - if(!$this->completelyMatchesPattern($value,$guidPattern)){ |
|
50 | + if(!$this->completelyMatchesPattern($value,$guidPattern)) { |
|
51 | 51 | throw new InvalidArgumentException( |
52 | 52 | sprintf("%s Should be assigned strings matching %s", __CLASS__, $guidPattern) |
53 | 53 | ); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | if (null !== $value) { |
48 | 48 | // stripe any white space |
49 | 49 | $value = preg_replace('/\s+/', '', $value); |
50 | - if(!ctype_xdigit($value)){ |
|
50 | + if (!ctype_xdigit($value)) { |
|
51 | 51 | throw new InvalidArgumentException( |
52 | 52 | sprintf("values assigned %s to should be hexadecimal string", __CLASS__)); |
53 | 53 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | if (null !== $value) { |
48 | 48 | // stripe any white space |
49 | 49 | $value = preg_replace('/\s+/', '', $value); |
50 | - if(!ctype_xdigit($value)){ |
|
50 | + if(!ctype_xdigit($value)) { |
|
51 | 51 | throw new InvalidArgumentException( |
52 | 52 | sprintf("values assigned %s to should be hexadecimal string", __CLASS__)); |
53 | 53 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | * @link https://docs.microsoft.com/en-us/openspecs/windows_protocols/mc-csdl/120e2b40-c73a-4b0b-98c2-8d2ab6b8dfd3 |
37 | 37 | * XSD Type: TIfExpression |
38 | 38 | */ |
39 | -class TIfExpressionType extends DynamicBase{ |
|
39 | +class TIfExpressionType extends DynamicBase { |
|
40 | 40 | /** |
41 | 41 | * @var string[] $string |
42 | 42 | */ |
@@ -36,7 +36,8 @@ |
||
36 | 36 | * @link https://docs.microsoft.com/en-us/openspecs/windows_protocols/mc-csdl/120e2b40-c73a-4b0b-98c2-8d2ab6b8dfd3 |
37 | 37 | * XSD Type: TIfExpression |
38 | 38 | */ |
39 | -class TIfExpressionType extends DynamicBase{ |
|
39 | +class TIfExpressionType extends DynamicBase |
|
40 | +{ |
|
40 | 41 | /** |
41 | 42 | * @var string[] $string |
42 | 43 | */ |
@@ -122,7 +122,7 @@ |
||
122 | 122 | * @param bool $isFlags |
123 | 123 | * @return self |
124 | 124 | */ |
125 | - public function setIsFlags( bool $isFlags):self |
|
125 | + public function setIsFlags(bool $isFlags):self |
|
126 | 126 | { |
127 | 127 | $this->isFlags = $isFlags; |
128 | 128 | return $this; |