@@ -78,7 +78,6 @@ |
||
78 | 78 | $this->eTag = $eTag; |
79 | 79 | $this->name = $name; |
80 | 80 | $this->srcLink = $srcLink; |
81 | - $this->rel = (null !== $rel) ? $rel : |
|
82 | - ODataConstants::ATOM_MEDIA_RESOURCE_RELATION_ATTRIBUTE_VALUE . $name; |
|
81 | + $this->rel = (null !== $rel) ? $rel : ODataConstants::ATOM_MEDIA_RESOURCE_RELATION_ATTRIBUTE_VALUE . $name; |
|
83 | 82 | } |
84 | 83 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | switch ($this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_LINK_RELATION_ATTRIBUTE_NAME, null)) { |
24 | 24 | case ODataConstants::ATOM_EDIT_RELATION_ATTRIBUTE_VALUE: |
25 | 25 | case ODataConstants::ODATA_RELATED_NAMESPACE . |
26 | - $this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_TITLE_ELELMET_NAME, ''): |
|
26 | + $this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_TITLE_ELELMET_NAME, ''): |
|
27 | 27 | $object = ODataLink::class; |
28 | 28 | break; |
29 | 29 | case ODataConstants::ATOM_EDIT_MEDIA_RELATION_ATTRIBUTE_VALUE: |
@@ -43,14 +43,14 @@ |
||
43 | 43 | public function handleStartNode($tagNamespace, $tagName, $attributes) |
44 | 44 | { |
45 | 45 | //The only sub notes that will exist will be the inline ones before we process the feed or entity. |
46 | - assert($tagNamespace === strtolower(ODataConstants::ODATA_METADATA_NAMESPACE)); |
|
46 | + assert($tagNamespace === strtolower(ODataConstants::ODATA_METADATA_NAMESPACE)); |
|
47 | 47 | assert($tagName === strtolower(ODataConstants::ATOM_INLINE_ELEMENT_NAME)); |
48 | 48 | } |
49 | 49 | |
50 | 50 | public function handleEndNode($tagNamespace, $tagName) |
51 | 51 | { |
52 | 52 | //The only sub notes that will exist will be the inline ones before we process the feed or entity. |
53 | - assert($tagNamespace === strtolower(ODataConstants::ODATA_METADATA_NAMESPACE)); |
|
53 | + assert($tagNamespace === strtolower(ODataConstants::ODATA_METADATA_NAMESPACE)); |
|
54 | 54 | assert($tagName === strtolower(ODataConstants::ATOM_INLINE_ELEMENT_NAME)); |
55 | 55 | } |
56 | 56 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | strtolower($tagNamespace) === strtolower(ODataConstants::ODATA_METADATA_NAMESPACE) && |
38 | 38 | strtolower($tagName) === strtolower((ODataConstants::ATOM_PROPERTIES_ELEMENT_NAME)) |
39 | 39 | ) { |
40 | - return ; |
|
40 | + return; |
|
41 | 41 | } |
42 | 42 | //TODO: this will need to be expanded with opengis namespaces as well when supported |
43 | 43 | assert($tagNamespace === ODataConstants::ODATA_NAMESPACE || |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | strtolower($tagNamespace) === strtolower(ODataConstants::ODATA_METADATA_NAMESPACE) && |
61 | 61 | strtolower($tagName) === strtolower((ODataConstants::ATOM_PROPERTIES_ELEMENT_NAME)) |
62 | 62 | ) { |
63 | - return ; |
|
63 | + return; |
|
64 | 64 | } |
65 | 65 | $prop = $this->properties->pop(); |
66 | 66 | $propContent = $this->propertyContent->pop(); |
@@ -116,7 +116,7 @@ |
||
116 | 116 | { |
117 | 117 | switch (strtolower($tagName)) { |
118 | 118 | case strtolower(ODataConstants::ROWCOUNT_ELEMENT): |
119 | - $this->oDataFeed->rowCount = (int)$this->popCharData(); |
|
119 | + $this->oDataFeed->rowCount = (int) $this->popCharData(); |
|
120 | 120 | break; |
121 | 121 | default: |
122 | 122 | $this->onParseError('Metadata', 'End', $tagName); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | return; |
68 | 68 | } |
69 | 69 | $method = 'handle' . $methodType . 'Atom' . ucfirst(strtolower($tagName)); |
70 | - if(!method_exists($this, $method)){ |
|
70 | + if (!method_exists($this, $method)) { |
|
71 | 71 | $this->onParseError('Atom', $methodType, $tagName); |
72 | 72 | } |
73 | 73 | $this->{$method}($attributes); |
@@ -76,19 +76,19 @@ discard block |
||
76 | 76 | |
77 | 77 | private function doNothing() |
78 | 78 | { |
79 | - return function(){}; |
|
79 | + return function () {}; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | private function bindHere(Closure $closure) |
83 | 83 | { |
84 | 84 | return $closure->bindTo($this, get_class($this)); |
85 | 85 | } |
86 | - private function enqueueEnd(Closure $closure){ |
|
86 | + private function enqueueEnd(Closure $closure) { |
|
87 | 87 | $this->tagEndQueue->push($this->bindHere($closure)); |
88 | 88 | } |
89 | 89 | protected function handleStartAtomId() |
90 | 90 | { |
91 | - $this->enqueueEnd(function(){ |
|
91 | + $this->enqueueEnd(function () { |
|
92 | 92 | $this->oDataEntry->id = $this->popCharData(); |
93 | 93 | }); |
94 | 94 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ODataConstants::ATOM_TYPE_ATTRIBUTE_NAME, |
100 | 100 | '' |
101 | 101 | ); |
102 | - $this->enqueueEnd(function(){ |
|
102 | + $this->enqueueEnd(function () { |
|
103 | 103 | $this->oDataEntry->title = new ODataTitle($this->popCharData(), $this->titleType); |
104 | 104 | $this->titleType = null; |
105 | 105 | }); |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | } |
112 | 112 | protected function handleStartAtomUpdated() |
113 | 113 | { |
114 | - $this->enqueueEnd(function(){ |
|
114 | + $this->enqueueEnd(function () { |
|
115 | 115 | $this->oDataEntry->updated = $this->popCharData(); |
116 | 116 | }); |
117 | 117 | } |
118 | 118 | protected function handleStartAtomLink($attributes) |
119 | 119 | { |
120 | 120 | $this->subProcessor = new LinkProcessor($attributes); |
121 | - $this->enqueueEnd(function(){ |
|
121 | + $this->enqueueEnd(function () { |
|
122 | 122 | assert($this->subProcessor instanceof LinkProcessor); |
123 | 123 | $this->handleLink($this->subProcessor->getObjetModelObject()); |
124 | 124 | $this->subProcessor = null; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'http://schemas.microsoft.com/ado/2007/08/dataservices/scheme' |
135 | 135 | ) |
136 | 136 | ); |
137 | - $this->enqueueEnd(function(){ |
|
137 | + $this->enqueueEnd(function () { |
|
138 | 138 | assert($this->objectModelSubNode instanceof ODataCategory); |
139 | 139 | $this->oDataEntry->setType($this->objectModelSubNode); |
140 | 140 | }); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $this->objectModelSubNode = new AtomContent( |
146 | 146 | $this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_TYPE_ATTRIBUTE_NAME, 'application/xml') |
147 | 147 | ); |
148 | - $this->enqueueEnd(function(){ |
|
148 | + $this->enqueueEnd(function () { |
|
149 | 149 | assert($this->objectModelSubNode instanceof AtomContent); |
150 | 150 | $this->objectModelSubNode->properties = $this->subProcessor->getObjetModelObject(); |
151 | 151 | $this->oDataEntry->setAtomContent($this->objectModelSubNode); |
@@ -197,19 +197,19 @@ discard block |
||
197 | 197 | break; |
198 | 198 | } |
199 | 199 | } |
200 | - private function handleODataLink(ODataLink $link ){ |
|
201 | - if($link->name === ODataConstants::ATOM_EDIT_RELATION_ATTRIBUTE_VALUE){ |
|
200 | + private function handleODataLink(ODataLink $link) { |
|
201 | + if ($link->name === ODataConstants::ATOM_EDIT_RELATION_ATTRIBUTE_VALUE) { |
|
202 | 202 | $this->oDataEntry->editLink = $link; |
203 | - }else{ |
|
203 | + } else { |
|
204 | 204 | $this->oDataEntry->links[] = $link; |
205 | 205 | } |
206 | 206 | } |
207 | 207 | private function handleODataMediaLink(ODataMediaLink $link) |
208 | 208 | { |
209 | - if($link->name === ODataConstants::ATOM_EDIT_MEDIA_RELATION_ATTRIBUTE_VALUE){ |
|
209 | + if ($link->name === ODataConstants::ATOM_EDIT_MEDIA_RELATION_ATTRIBUTE_VALUE) { |
|
210 | 210 | $this->oDataEntry->mediaLink = $link; |
211 | 211 | $this->oDataEntry->isMediaLinkEntry = true; |
212 | - }else{ |
|
212 | + } else { |
|
213 | 213 | $this->oDataEntry->mediaLinks[] = $link; |
214 | 214 | } |
215 | 215 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | return; |
68 | 68 | } |
69 | 69 | $method = 'handle' . $methodType . 'Atom' . ucfirst(strtolower($tagName)); |
70 | - if(!method_exists($this, $method)){ |
|
70 | + if(!method_exists($this, $method)) { |
|
71 | 71 | $this->onParseError('Atom', $methodType, $tagName); |
72 | 72 | } |
73 | 73 | $this->{$method}($attributes); |
@@ -83,12 +83,13 @@ discard block |
||
83 | 83 | { |
84 | 84 | return $closure->bindTo($this, get_class($this)); |
85 | 85 | } |
86 | - private function enqueueEnd(Closure $closure){ |
|
86 | + private function enqueueEnd(Closure $closure) |
|
87 | + { |
|
87 | 88 | $this->tagEndQueue->push($this->bindHere($closure)); |
88 | 89 | } |
89 | 90 | protected function handleStartAtomId() |
90 | 91 | { |
91 | - $this->enqueueEnd(function(){ |
|
92 | + $this->enqueueEnd(function() { |
|
92 | 93 | $this->oDataEntry->id = $this->popCharData(); |
93 | 94 | }); |
94 | 95 | } |
@@ -99,7 +100,7 @@ discard block |
||
99 | 100 | ODataConstants::ATOM_TYPE_ATTRIBUTE_NAME, |
100 | 101 | '' |
101 | 102 | ); |
102 | - $this->enqueueEnd(function(){ |
|
103 | + $this->enqueueEnd(function() { |
|
103 | 104 | $this->oDataEntry->title = new ODataTitle($this->popCharData(), $this->titleType); |
104 | 105 | $this->titleType = null; |
105 | 106 | }); |
@@ -111,14 +112,14 @@ discard block |
||
111 | 112 | } |
112 | 113 | protected function handleStartAtomUpdated() |
113 | 114 | { |
114 | - $this->enqueueEnd(function(){ |
|
115 | + $this->enqueueEnd(function() { |
|
115 | 116 | $this->oDataEntry->updated = $this->popCharData(); |
116 | 117 | }); |
117 | 118 | } |
118 | 119 | protected function handleStartAtomLink($attributes) |
119 | 120 | { |
120 | 121 | $this->subProcessor = new LinkProcessor($attributes); |
121 | - $this->enqueueEnd(function(){ |
|
122 | + $this->enqueueEnd(function() { |
|
122 | 123 | assert($this->subProcessor instanceof LinkProcessor); |
123 | 124 | $this->handleLink($this->subProcessor->getObjetModelObject()); |
124 | 125 | $this->subProcessor = null; |
@@ -134,7 +135,7 @@ discard block |
||
134 | 135 | 'http://schemas.microsoft.com/ado/2007/08/dataservices/scheme' |
135 | 136 | ) |
136 | 137 | ); |
137 | - $this->enqueueEnd(function(){ |
|
138 | + $this->enqueueEnd(function() { |
|
138 | 139 | assert($this->objectModelSubNode instanceof ODataCategory); |
139 | 140 | $this->oDataEntry->setType($this->objectModelSubNode); |
140 | 141 | }); |
@@ -145,7 +146,7 @@ discard block |
||
145 | 146 | $this->objectModelSubNode = new AtomContent( |
146 | 147 | $this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_TYPE_ATTRIBUTE_NAME, 'application/xml') |
147 | 148 | ); |
148 | - $this->enqueueEnd(function(){ |
|
149 | + $this->enqueueEnd(function() { |
|
149 | 150 | assert($this->objectModelSubNode instanceof AtomContent); |
150 | 151 | $this->objectModelSubNode->properties = $this->subProcessor->getObjetModelObject(); |
151 | 152 | $this->oDataEntry->setAtomContent($this->objectModelSubNode); |
@@ -197,19 +198,20 @@ discard block |
||
197 | 198 | break; |
198 | 199 | } |
199 | 200 | } |
200 | - private function handleODataLink(ODataLink $link ){ |
|
201 | - if($link->name === ODataConstants::ATOM_EDIT_RELATION_ATTRIBUTE_VALUE){ |
|
201 | + private function handleODataLink(ODataLink $link ) |
|
202 | + { |
|
203 | + if($link->name === ODataConstants::ATOM_EDIT_RELATION_ATTRIBUTE_VALUE) { |
|
202 | 204 | $this->oDataEntry->editLink = $link; |
203 | - }else{ |
|
205 | + } else { |
|
204 | 206 | $this->oDataEntry->links[] = $link; |
205 | 207 | } |
206 | 208 | } |
207 | 209 | private function handleODataMediaLink(ODataMediaLink $link) |
208 | 210 | { |
209 | - if($link->name === ODataConstants::ATOM_EDIT_MEDIA_RELATION_ATTRIBUTE_VALUE){ |
|
211 | + if($link->name === ODataConstants::ATOM_EDIT_MEDIA_RELATION_ATTRIBUTE_VALUE) { |
|
210 | 212 | $this->oDataEntry->mediaLink = $link; |
211 | 213 | $this->oDataEntry->isMediaLinkEntry = true; |
212 | - }else{ |
|
214 | + } else { |
|
213 | 215 | $this->oDataEntry->mediaLinks[] = $link; |
214 | 216 | } |
215 | 217 | } |