@@ -22,8 +22,8 @@ |
||
22 | 22 | |
23 | 23 | public function buildPreparedStatement($statement, $sqlString) |
24 | 24 | { |
25 | - $factory = new TPreparedStatementFactory($statement, $sqlString); |
|
26 | - $this->_preparedStatement = $factory->prepare(); |
|
25 | + $factory=new TPreparedStatementFactory($statement, $sqlString); |
|
26 | + $this->_preparedStatement=$factory->prepare(); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function getPreparedStatement($parameter=null) |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function registerTypeHandler(TSqlMapTypeHandler $handler) |
49 | 49 | { |
50 | - $this->_typeHandlers[$handler->getType()] = $handler; |
|
50 | + $this->_typeHandlers[$handler->getType()]=$handler; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | switch(strtolower($type)) |
91 | 91 | { |
92 | 92 | case 'integer': case 'int': |
93 | - $type = 'integer'; break; |
|
93 | + $type='integer'; break; |
|
94 | 94 | case 'float': case 'double': case 'decimal': |
95 | - $type = 'float'; break; |
|
95 | + $type='float'; break; |
|
96 | 96 | case 'boolean': case 'bool': |
97 | - $type = 'boolean'; break; |
|
97 | + $type='boolean'; break; |
|
98 | 98 | case 'string' : |
99 | - $type = 'string'; break; |
|
99 | + $type='string'; break; |
|
100 | 100 | default: |
101 | 101 | return $value; |
102 | 102 | } |
@@ -181,22 +181,18 @@ discard block |
||
181 | 181 | $this->_currentPageIndex=$pageIndex; |
182 | 182 | $this->onPageIndexChanged(new TPagedListPageChangedEventParameter($oldPage)); |
183 | 183 | return $pageIndex; |
184 | - } |
|
185 | - else |
|
184 | + } else |
|
186 | 185 | return false; |
187 | - } |
|
188 | - else |
|
186 | + } else |
|
189 | 187 | return false; |
190 | - } |
|
191 | - else |
|
188 | + } else |
|
192 | 189 | { |
193 | 190 | if($pageIndex>=0 && $pageIndex<$this->getPageCount()) |
194 | 191 | { |
195 | 192 | $this->_currentPageIndex=$pageIndex; |
196 | 193 | $this->onPageIndexChanged(null); |
197 | 194 | return $pageIndex; |
198 | - } |
|
199 | - else |
|
195 | + } else |
|
200 | 196 | return false; |
201 | 197 | } |
202 | 198 | } |
@@ -248,8 +244,7 @@ discard block |
||
248 | 244 | return (int)(($this->_virtualCount+$this->_pageSize-1)/$this->_pageSize); |
249 | 245 | else |
250 | 246 | return -1; |
251 | - } |
|
252 | - else |
|
247 | + } else |
|
253 | 248 | return (int)((parent::getCount()+$this->_pageSize-1)/$this->_pageSize); |
254 | 249 | } |
255 | 250 |
@@ -96,6 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | /** |
98 | 98 | * @param boolean whether to allow custom paging |
99 | + * @param boolean $value |
|
99 | 100 | */ |
100 | 101 | public function setCustomPaging($value) |
101 | 102 | { |
@@ -143,6 +144,7 @@ discard block |
||
143 | 144 | * Raises <b>OnPageIndexChanged</b> event. |
144 | 145 | * This event is raised each time when the list changes to a different page. |
145 | 146 | * @param TPagedListPageChangedEventParameter event parameter |
147 | + * @param TPagedListPageChangedEventParameter|null $param |
|
146 | 148 | */ |
147 | 149 | public function onPageIndexChanged($param) |
148 | 150 | { |
@@ -155,6 +157,7 @@ discard block |
||
155 | 157 | * and needs the new page of data. This event can only be raised when |
156 | 158 | * {@link setCustomPaging CustomPaging} is true. |
157 | 159 | * @param TPagedListFetchDataEventParameter event parameter |
160 | + * @param TPagedListFetchDataEventParameter $param |
|
158 | 161 | */ |
159 | 162 | public function onFetchData($param) |
160 | 163 | { |
@@ -290,7 +293,7 @@ discard block |
||
290 | 293 | } |
291 | 294 | |
292 | 295 | /** |
293 | - * @return Iterator iterator |
|
296 | + * @return \ArrayIterator iterator |
|
294 | 297 | */ |
295 | 298 | public function getIterator() |
296 | 299 | { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function setPageSize($value) |
118 | 118 | { |
119 | - if(($value=TPropertyValue::ensureInteger($value))>0) |
|
119 | + if(($value=TPropertyValue::ensureInteger($value)) > 0) |
|
120 | 120 | $this->_pageSize=$value; |
121 | 121 | else |
122 | 122 | throw new TInvalidDataValueException('pagedlist_pagesize_invalid'); |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | return $pageIndex; |
174 | 174 | if($this->_customPaging) |
175 | 175 | { |
176 | - if($pageIndex>=0 && ($this->_virtualCount<0 || $pageIndex<$this->getPageCount())) |
|
176 | + if($pageIndex >= 0 && ($this->_virtualCount < 0 || $pageIndex < $this->getPageCount())) |
|
177 | 177 | { |
178 | - $param=new TPagedListFetchDataEventParameter($pageIndex, $this->_pageSize*$pageIndex, $this->_pageSize); |
|
178 | + $param=new TPagedListFetchDataEventParameter($pageIndex, $this->_pageSize * $pageIndex, $this->_pageSize); |
|
179 | 179 | $this->onFetchData($param); |
180 | 180 | if(($data=$param->getData())!==null) |
181 | 181 | { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | else |
197 | 197 | { |
198 | - if($pageIndex>=0 && $pageIndex<$this->getPageCount()) |
|
198 | + if($pageIndex >= 0 && $pageIndex < $this->getPageCount()) |
|
199 | 199 | { |
200 | 200 | $this->_currentPageIndex=$pageIndex; |
201 | 201 | $this->onPageIndexChanged(null); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function nextPage() |
214 | 214 | { |
215 | - return $this->gotoPage($this->_currentPageIndex+1); |
|
215 | + return $this->gotoPage($this->_currentPageIndex + 1); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function previousPage() |
223 | 223 | { |
224 | - return $this->gotoPage($this->_currentPageIndex-1); |
|
224 | + return $this->gotoPage($this->_currentPageIndex - 1); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function setVirtualCount($value) |
239 | 239 | { |
240 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
240 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
241 | 241 | $value=-1; |
242 | 242 | $this->_virtualCount=$value; |
243 | 243 | } |
@@ -249,13 +249,13 @@ discard block |
||
249 | 249 | { |
250 | 250 | if($this->_customPaging) |
251 | 251 | { |
252 | - if($this->_virtualCount>=0) |
|
253 | - return (int)(($this->_virtualCount+$this->_pageSize-1)/$this->_pageSize); |
|
252 | + if($this->_virtualCount >= 0) |
|
253 | + return (int) (($this->_virtualCount + $this->_pageSize - 1) / $this->_pageSize); |
|
254 | 254 | else |
255 | 255 | return -1; |
256 | 256 | } |
257 | 257 | else |
258 | - return (int)((parent::getCount()+$this->_pageSize-1)/$this->_pageSize); |
|
258 | + return (int) ((parent::getCount() + $this->_pageSize - 1) / $this->_pageSize); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function getIsLastPage() |
273 | 273 | { |
274 | - return $this->_currentPageIndex===$this->getPageCount()-1; |
|
274 | + return $this->_currentPageIndex===$this->getPageCount() - 1; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | return parent::getCount(); |
284 | 284 | else |
285 | 285 | { |
286 | - if($this->_currentPageIndex===$this->getPageCount()-1) |
|
287 | - return parent::getCount()-$this->_pageSize*$this->_currentPageIndex; |
|
286 | + if($this->_currentPageIndex===$this->getPageCount() - 1) |
|
287 | + return parent::getCount() - $this->_pageSize * $this->_currentPageIndex; |
|
288 | 288 | else |
289 | 289 | return $this->_pageSize; |
290 | 290 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | if($this->_customPaging) |
317 | 317 | return parent::itemAt($index); |
318 | 318 | else |
319 | - return parent::itemAt($this->_pageSize*$this->_currentPageIndex+$index); |
|
319 | + return parent::itemAt($this->_pageSize * $this->_currentPageIndex + $index); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | public function indexOf($item) |
327 | 327 | { |
328 | 328 | $c=$this->getCount(); |
329 | - for($i=0;$i<$c;++$i) |
|
329 | + for($i=0; $i < $c; ++$i) |
|
330 | 330 | if($this->itemAt($i)===$item) |
331 | 331 | return $i; |
332 | 332 | return -1; |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function offsetExists($offset) |
342 | 342 | { |
343 | - return ($offset>=0 && $offset<$this->getCount()); |
|
343 | + return ($offset >= 0 && $offset < $this->getCount()); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | { |
363 | 363 | $c=$this->getCount(); |
364 | 364 | $array=[]; |
365 | - for($i=0;$i<$c;++$i) |
|
365 | + for($i=0; $i < $c; ++$i) |
|
366 | 366 | $array[$i]=$this->itemAt($i); |
367 | 367 | return $array; |
368 | 368 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * To trim or not to trim the contents. |
51 | 51 | * @var boolean |
52 | 52 | */ |
53 | - protected $trim = true; |
|
53 | + protected $trim=true; |
|
54 | 54 | |
55 | 55 | |
56 | 56 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function setKey($value) |
72 | 72 | { |
73 | - $this->key = $value; |
|
73 | + $this->key=$value; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setTrim($value) |
81 | 81 | { |
82 | - $this->trim = TPropertyValue::ensureBoolean($value); |
|
82 | + $this->trim=TPropertyValue::ensureBoolean($value); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function getParameter() |
108 | 108 | { |
109 | - $value = $this->getValue(); |
|
109 | + $value=$this->getValue(); |
|
110 | 110 | if(strlen($value) > 0) |
111 | 111 | return $value; |
112 | - $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
112 | + $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
113 | 113 | $this->renderControl($htmlWriter); |
114 | 114 | return $this->getTrim() ? |
115 | 115 | trim($htmlWriter->flush()) : $htmlWriter->flush(); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function setText($value) |
52 | 52 | { |
53 | - if(parent::getText() === $value) |
|
53 | + if(parent::getText()===$value) |
|
54 | 54 | return; |
55 | 55 | |
56 | 56 | parent::setText($value); |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function setImageUrl($value) |
66 | 66 | { |
67 | - if(parent::getImageUrl() === $value) |
|
67 | + if(parent::getImageUrl()===$value) |
|
68 | 68 | return; |
69 | 69 | |
70 | 70 | parent::setImageUrl($value); |
71 | - if($this->getActiveControl()->canUpdateClientSide() && $value !== '') |
|
71 | + if($this->getActiveControl()->canUpdateClientSide() && $value!=='') |
|
72 | 72 | { |
73 | - $textWriter = new TTextWriter; |
|
74 | - $renderer = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $textWriter); |
|
73 | + $textWriter=new TTextWriter; |
|
74 | + $renderer=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $textWriter); |
|
75 | 75 | $this->createImage($value)->renderControl($renderer); |
76 | 76 | $this->getPage()->getCallbackClient()->update($this, $textWriter->flush()); |
77 | 77 | } |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function setNavigateUrl($value) |
85 | 85 | { |
86 | - if(parent::getNavigateUrl() === $value) |
|
86 | + if(parent::getNavigateUrl()===$value) |
|
87 | 87 | return; |
88 | 88 | |
89 | 89 | parent::setNavigateUrl($value); |
90 | 90 | if($this->getActiveControl()->canUpdateClientSide()) |
91 | 91 | { |
92 | 92 | //replace & with & and urldecode the url (setting the href using javascript is literal) |
93 | - $url = urldecode(str_replace('&', '&', $value)); |
|
93 | + $url=urldecode(str_replace('&', '&', $value)); |
|
94 | 94 | $this->getPage()->getCallbackClient()->setAttribute($this, 'href', $url); |
95 | 95 | } |
96 | 96 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function setTarget($value) |
103 | 103 | { |
104 | - if(parent::getTarget() === $value) |
|
104 | + if(parent::getTarget()===$value) |
|
105 | 105 | return; |
106 | 106 | |
107 | 107 | parent::setTarget($value); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function setAlternateText($value) |
50 | 50 | { |
51 | - if(parent::getAlternateText() === $value) |
|
51 | + if(parent::getAlternateText()===$value) |
|
52 | 52 | return; |
53 | 53 | |
54 | 54 | parent::setAlternateText($value); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function setImageAlign($value) |
67 | 67 | { |
68 | - if(parent::getImageAlign() === $value) |
|
68 | + if(parent::getImageAlign()===$value) |
|
69 | 69 | return; |
70 | 70 | |
71 | 71 | parent::setImageAlign($value); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function setImageUrl($value) |
80 | 80 | { |
81 | - if(parent::getImageUrl() === $value) |
|
81 | + if(parent::getImageUrl()===$value) |
|
82 | 82 | return; |
83 | 83 | |
84 | 84 | parent::setImageUrl($value); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setDescriptionUrl($value) |
93 | 93 | { |
94 | - if(parent::getDescriptionUrl() === $value) |
|
94 | + if(parent::getDescriptionUrl()===$value) |
|
95 | 95 | return; |
96 | 96 | |
97 | 97 | parent::setDescriptionUrl($value); |
@@ -48,6 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Sets the alternative text to be displayed in the TImage when the image is unavailable. |
50 | 50 | * @param string the alternative text |
51 | + * @param string $value |
|
51 | 52 | */ |
52 | 53 | public function setAlternateText($value) |
53 | 54 | { |
@@ -78,6 +79,7 @@ discard block |
||
78 | 79 | |
79 | 80 | /** |
80 | 81 | * @param string the URL of the image file |
82 | + * @param string $value |
|
81 | 83 | */ |
82 | 84 | public function setImageUrl($value) |
83 | 85 | { |
@@ -48,7 +48,7 @@ |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * @return Iterator iterator |
|
51 | + * @return TDummyDataSourceIterator iterator |
|
52 | 52 | */ |
53 | 53 | public function getIterator() |
54 | 54 | { |
@@ -81,6 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | /** |
83 | 83 | * @param boolean whether this list is read-only or not |
84 | + * @param boolean $value |
|
84 | 85 | */ |
85 | 86 | protected function setReadOnly($value) |
86 | 87 | { |
@@ -90,7 +91,7 @@ discard block |
||
90 | 91 | /** |
91 | 92 | * Returns an iterator for traversing the items in the list. |
92 | 93 | * This method is required by the interface \IteratorAggregate. |
93 | - * @return Iterator an iterator for traversing the items in the list. |
|
94 | + * @return \ArrayIterator an iterator for traversing the items in the list. |
|
94 | 95 | */ |
95 | 96 | public function getIterator() |
96 | 97 | { |
@@ -283,7 +284,7 @@ discard block |
||
283 | 284 | * Finds the base item. If found, the item is inserted after it. |
284 | 285 | * @param mixed the base item which comes before the second parameter when added to the list |
285 | 286 | * @param mixed the item |
286 | - * @return int the index where the item is inserted |
|
287 | + * @return double the index where the item is inserted |
|
287 | 288 | * @throws TInvalidDataValueException if the base item is not within this list |
288 | 289 | * @throws TInvalidOperationException if the list is read-only |
289 | 290 | * @since 3.2a |
@@ -334,6 +335,7 @@ discard block |
||
334 | 335 | * Merges iterable data into the map. |
335 | 336 | * New data will be appended to the end of the existing data. |
336 | 337 | * @param mixed the data to be merged with, must be an array or object implementing Traversable |
338 | + * @param \Prado\Web\UI\WebControls\TDataGridColumnCollection|null $data |
|
337 | 339 | * @throws TInvalidDataTypeException If data is neither an array nor an iterator. |
338 | 340 | */ |
339 | 341 | public function mergeWith($data) |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function itemAt($index) |
127 | 127 | { |
128 | - if($index>=0 && $index<$this->_c) |
|
128 | + if($index >= 0 && $index < $this->_c) |
|
129 | 129 | return $this->_d[$index]; |
130 | 130 | else |
131 | 131 | throw new TInvalidDataValueException('list_index_invalid', $index); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | public function add($item) |
141 | 141 | { |
142 | 142 | $this->insertAt($this->_c, $item); |
143 | - return $this->_c-1; |
|
143 | + return $this->_c - 1; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | { |
159 | 159 | if($index===$this->_c) |
160 | 160 | $this->_d[$this->_c++]=$item; |
161 | - elseif($index>=0 && $index<$this->_c) |
|
161 | + elseif($index >= 0 && $index < $this->_c) |
|
162 | 162 | { |
163 | 163 | array_splice($this->_d, $index, 0, [$item]); |
164 | 164 | $this->_c++; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | { |
184 | 184 | if(!$this->_r) |
185 | 185 | { |
186 | - if(($index=$this->indexOf($item))>=0) |
|
186 | + if(($index=$this->indexOf($item)) >= 0) |
|
187 | 187 | { |
188 | 188 | $this->removeAt($index); |
189 | 189 | return $index; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | { |
207 | 207 | if(!$this->_r) |
208 | 208 | { |
209 | - if($index>=0 && $index<$this->_c) |
|
209 | + if($index >= 0 && $index < $this->_c) |
|
210 | 210 | { |
211 | 211 | $this->_c--; |
212 | 212 | if($index===$this->_c) |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function clear() |
233 | 233 | { |
234 | - for($i=$this->_c-1;$i>=0;--$i) |
|
234 | + for($i=$this->_c - 1; $i >= 0; --$i) |
|
235 | 235 | $this->removeAt($i); |
236 | 236 | } |
237 | 237 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public function contains($item) |
243 | 243 | { |
244 | - return $this->indexOf($item)>=0; |
|
244 | + return $this->indexOf($item) >= 0; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | { |
270 | 270 | if(!$this->_r) |
271 | 271 | { |
272 | - if(($index = $this->indexOf($baseitem)) == -1) |
|
272 | + if(($index=$this->indexOf($baseitem))==-1) |
|
273 | 273 | throw new TInvalidDataValueException('list_item_inexistent'); |
274 | 274 | |
275 | 275 | $this->insertAt($index, $item); |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | { |
294 | 294 | if(!$this->_r) |
295 | 295 | { |
296 | - if(($index = $this->indexOf($baseitem)) == -1) |
|
296 | + if(($index=$this->indexOf($baseitem))==-1) |
|
297 | 297 | throw new TInvalidDataValueException('list_item_inexistent'); |
298 | 298 | |
299 | 299 | $this->insertAt($index + 1, $item); |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | { |
323 | 323 | if(is_array($data) || ($data instanceof \Traversable)) |
324 | 324 | { |
325 | - if($this->_c>0) |
|
325 | + if($this->_c > 0) |
|
326 | 326 | $this->clear(); |
327 | 327 | foreach($data as $item) |
328 | 328 | $this->add($item); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | */ |
357 | 357 | public function offsetExists($offset) |
358 | 358 | { |
359 | - return ($offset>=0 && $offset<$this->_c); |
|
359 | + return ($offset >= 0 && $offset < $this->_c); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
@@ -162,11 +162,9 @@ discard block |
||
162 | 162 | { |
163 | 163 | array_splice($this->_d, $index, 0, [$item]); |
164 | 164 | $this->_c++; |
165 | - } |
|
166 | - else |
|
165 | + } else |
|
167 | 166 | throw new TInvalidDataValueException('list_index_invalid', $index); |
168 | - } |
|
169 | - else |
|
167 | + } else |
|
170 | 168 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
171 | 169 | } |
172 | 170 | |
@@ -187,11 +185,9 @@ discard block |
||
187 | 185 | { |
188 | 186 | $this->removeAt($index); |
189 | 187 | return $index; |
190 | - } |
|
191 | - else |
|
188 | + } else |
|
192 | 189 | throw new TInvalidDataValueException('list_item_inexistent'); |
193 | - } |
|
194 | - else |
|
190 | + } else |
|
195 | 191 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
196 | 192 | } |
197 | 193 | |
@@ -217,11 +213,9 @@ discard block |
||
217 | 213 | array_splice($this->_d, $index, 1); |
218 | 214 | return $item; |
219 | 215 | } |
220 | - } |
|
221 | - else |
|
216 | + } else |
|
222 | 217 | throw new TInvalidDataValueException('list_index_invalid', $index); |
223 | - } |
|
224 | - else |
|
218 | + } else |
|
225 | 219 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
226 | 220 | } |
227 | 221 | |
@@ -275,8 +269,7 @@ discard block |
||
275 | 269 | $this->insertAt($index, $item); |
276 | 270 | |
277 | 271 | return $index; |
278 | - } |
|
279 | - else |
|
272 | + } else |
|
280 | 273 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
281 | 274 | } |
282 | 275 | |
@@ -299,8 +292,7 @@ discard block |
||
299 | 292 | $this->insertAt($index + 1, $item); |
300 | 293 | |
301 | 294 | return $index + 1; |
302 | - } |
|
303 | - else |
|
295 | + } else |
|
304 | 296 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
305 | 297 | } |
306 | 298 | |
@@ -326,8 +318,7 @@ discard block |
||
326 | 318 | $this->clear(); |
327 | 319 | foreach($data as $item) |
328 | 320 | $this->add($item); |
329 | - } |
|
330 | - elseif($data!==null) |
|
321 | + } elseif($data!==null) |
|
331 | 322 | throw new TInvalidDataTypeException('list_data_not_iterable'); |
332 | 323 | } |
333 | 324 | |
@@ -343,8 +334,7 @@ discard block |
||
343 | 334 | { |
344 | 335 | foreach($data as $item) |
345 | 336 | $this->add($item); |
346 | - } |
|
347 | - elseif($data!==null) |
|
337 | + } elseif($data!==null) |
|
348 | 338 | throw new TInvalidDataTypeException('list_data_not_iterable'); |
349 | 339 | } |
350 | 340 |
@@ -86,6 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | /** |
88 | 88 | * @param boolean whether this list is read-only or not |
89 | + * @param boolean $value |
|
89 | 90 | */ |
90 | 91 | protected function setReadOnly($value) |
91 | 92 | { |
@@ -95,7 +96,7 @@ discard block |
||
95 | 96 | /** |
96 | 97 | * Returns an iterator for traversing the items in the list. |
97 | 98 | * This method is required by the interface \IteratorAggregate. |
98 | - * @return Iterator an iterator for traversing the items in the list. |
|
99 | + * @return \ArrayIterator an iterator for traversing the items in the list. |
|
99 | 100 | */ |
100 | 101 | public function getIterator() |
101 | 102 | { |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | protected function _getZappableSleepProps(&$exprops) |
58 | 58 | { |
59 | 59 | parent::_getZappableSleepProps($exprops); |
60 | - if ($this->_d===[]) |
|
61 | - $exprops[] = "\0Prado\Collections\TMap\0_d"; |
|
62 | - if ($this->_r===false) |
|
63 | - $exprops[] = "\0Prado\Collections\TMap\0_r"; |
|
60 | + if($this->_d===[]) |
|
61 | + $exprops[]="\0Prado\Collections\TMap\0_d"; |
|
62 | + if($this->_r===false) |
|
63 | + $exprops[]="\0Prado\Collections\TMap\0_r"; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | { |
215 | 215 | if(is_array($data) || $data instanceof Traversable) |
216 | 216 | { |
217 | - if($this->getCount()>0) |
|
217 | + if($this->getCount() > 0) |
|
218 | 218 | $this->clear(); |
219 | 219 | foreach($data as $key=>$value) |
220 | 220 | $this->add($key, $value); |
@@ -170,11 +170,9 @@ discard block |
||
170 | 170 | $value=$this->_d[$key]; |
171 | 171 | unset($this->_d[$key]); |
172 | 172 | return $value; |
173 | - } |
|
174 | - else |
|
173 | + } else |
|
175 | 174 | return null; |
176 | - } |
|
177 | - else |
|
175 | + } else |
|
178 | 176 | throw new TInvalidOperationException('map_readonly', get_class($this)); |
179 | 177 | } |
180 | 178 | |
@@ -218,8 +216,7 @@ discard block |
||
218 | 216 | $this->clear(); |
219 | 217 | foreach($data as $key=>$value) |
220 | 218 | $this->add($key, $value); |
221 | - } |
|
222 | - elseif($data!==null) |
|
219 | + } elseif($data!==null) |
|
223 | 220 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
224 | 221 | } |
225 | 222 | |
@@ -235,8 +232,7 @@ discard block |
||
235 | 232 | { |
236 | 233 | foreach($data as $key=>$value) |
237 | 234 | $this->add($key, $value); |
238 | - } |
|
239 | - elseif($data!==null) |
|
235 | + } elseif($data!==null) |
|
240 | 236 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
241 | 237 | } |
242 | 238 |