@@ -41,23 +41,23 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * @var integer number of items in each page |
| 43 | 43 | */ |
| 44 | - private $_pageSize = 10; |
|
| 44 | + private $_pageSize=10; |
|
| 45 | 45 | /** |
| 46 | 46 | * @var integer current page index |
| 47 | 47 | */ |
| 48 | - private $_currentPageIndex = 0; |
|
| 48 | + private $_currentPageIndex=0; |
|
| 49 | 49 | /** |
| 50 | 50 | * @var boolean whether to allow paging |
| 51 | 51 | */ |
| 52 | - private $_allowPaging = false; |
|
| 52 | + private $_allowPaging=false; |
|
| 53 | 53 | /** |
| 54 | 54 | * @var boolean whether to allow custom paging |
| 55 | 55 | */ |
| 56 | - private $_allowCustomPaging = false; |
|
| 56 | + private $_allowCustomPaging=false; |
|
| 57 | 57 | /** |
| 58 | 58 | * @var integer user-assigned number of items in data source |
| 59 | 59 | */ |
| 60 | - private $_virtualCount = 0; |
|
| 60 | + private $_virtualCount=0; |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * @return mixed original data source. Defaults to null. |
@@ -75,13 +75,13 @@ discard block |
||
| 75 | 75 | if(!($value instanceof TMap) && !($value instanceof TList)) |
| 76 | 76 | { |
| 77 | 77 | if(is_array($value)) |
| 78 | - $value = new TMap($value); |
|
| 78 | + $value=new TMap($value); |
|
| 79 | 79 | elseif($value instanceof \Traversable) |
| 80 | - $value = new TList($value); |
|
| 81 | - elseif($value !== null) |
|
| 80 | + $value=new TList($value); |
|
| 81 | + elseif($value!==null) |
|
| 82 | 82 | throw new TInvalidDataTypeException('pageddatasource_datasource_invalid'); |
| 83 | 83 | } |
| 84 | - $this->_dataSource = $value; |
|
| 84 | + $this->_dataSource=$value; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function setPageSize($value) |
| 99 | 99 | { |
| 100 | - if(($value = TPropertyValue::ensureInteger($value)) > 0) |
|
| 101 | - $this->_pageSize = $value; |
|
| 100 | + if(($value=TPropertyValue::ensureInteger($value)) > 0) |
|
| 101 | + $this->_pageSize=$value; |
|
| 102 | 102 | else |
| 103 | 103 | throw new TInvalidDataValueException('pageddatasource_pagesize_invalid'); |
| 104 | 104 | } |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function setCurrentPageIndex($value) |
| 118 | 118 | { |
| 119 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
| 120 | - $value = 0; |
|
| 121 | - $this->_currentPageIndex = $value; |
|
| 119 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
| 120 | + $value=0; |
|
| 121 | + $this->_currentPageIndex=$value; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function setAllowPaging($value) |
| 136 | 136 | { |
| 137 | - $this->_allowPaging = TPropertyValue::ensureBoolean($value); |
|
| 137 | + $this->_allowPaging=TPropertyValue::ensureBoolean($value); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function setAllowCustomPaging($value) |
| 152 | 152 | { |
| 153 | - $this->_allowCustomPaging = TPropertyValue::ensureBoolean($value); |
|
| 153 | + $this->_allowCustomPaging=TPropertyValue::ensureBoolean($value); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function setVirtualItemCount($value) |
| 168 | 168 | { |
| 169 | - if(($value = TPropertyValue::ensureInteger($value)) >= 0) |
|
| 170 | - $this->_virtualCount = $value; |
|
| 169 | + if(($value=TPropertyValue::ensureInteger($value)) >= 0) |
|
| 170 | + $this->_virtualCount=$value; |
|
| 171 | 171 | else |
| 172 | 172 | throw new TInvalidDataValueException('pageddatasource_virtualitemcount_invalid'); |
| 173 | 173 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | public function getCount() |
| 179 | 179 | { |
| 180 | - if($this->_dataSource === null) |
|
| 180 | + if($this->_dataSource===null) |
|
| 181 | 181 | return 0; |
| 182 | 182 | if(!$this->_allowPaging) |
| 183 | 183 | return $this->getDataSourceCount(); |
@@ -201,12 +201,12 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function getPageCount() |
| 203 | 203 | { |
| 204 | - if($this->_dataSource === null) |
|
| 204 | + if($this->_dataSource===null) |
|
| 205 | 205 | return 0; |
| 206 | - $count = $this->getDataSourceCount(); |
|
| 206 | + $count=$this->getDataSourceCount(); |
|
| 207 | 207 | if(!$this->_allowPaging || $count <= 0) |
| 208 | 208 | return 1; |
| 209 | - return (int)(($count + $this->_pageSize - 1) / $this->_pageSize); |
|
| 209 | + return (int) (($count + $this->_pageSize - 1) / $this->_pageSize); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /** |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | public function getIsFirstPage() |
| 216 | 216 | { |
| 217 | 217 | if($this->_allowPaging) |
| 218 | - return $this->_currentPageIndex === 0; |
|
| 218 | + return $this->_currentPageIndex===0; |
|
| 219 | 219 | else |
| 220 | 220 | return true; |
| 221 | 221 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | public function getIsLastPage() |
| 227 | 227 | { |
| 228 | 228 | if($this->_allowPaging) |
| 229 | - return $this->_currentPageIndex === $this->getPageCount() - 1; |
|
| 229 | + return $this->_currentPageIndex===$this->getPageCount() - 1; |
|
| 230 | 230 | else |
| 231 | 231 | return true; |
| 232 | 232 | } |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | public function getFirstIndexInPage() |
| 239 | 239 | { |
| 240 | - if($this->_dataSource !== null && $this->_allowPaging && !$this->_allowCustomPaging) |
|
| 240 | + if($this->_dataSource!==null && $this->_allowPaging && !$this->_allowCustomPaging) |
|
| 241 | 241 | return $this->_currentPageIndex * $this->_pageSize; |
| 242 | 242 | else |
| 243 | 243 | return 0; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | public function getDataSourceCount() |
| 250 | 250 | { |
| 251 | - if($this->_dataSource === null) |
|
| 251 | + if($this->_dataSource===null) |
|
| 252 | 252 | return 0; |
| 253 | 253 | elseif($this->_allowCustomPaging) |
| 254 | 254 | return $this->_virtualCount; |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | /** |
| 58 | 58 | * @var array internal data storage |
| 59 | 59 | */ |
| 60 | - private $_d = []; |
|
| 60 | + private $_d=[]; |
|
| 61 | 61 | /** |
| 62 | 62 | * @var boolean indicates if the _d is currently ordered. |
| 63 | 63 | */ |
| 64 | - private $_o = false; |
|
| 64 | + private $_o=false; |
|
| 65 | 65 | /** |
| 66 | 66 | * @var array cached flattened internal data storage |
| 67 | 67 | */ |
@@ -69,15 +69,15 @@ discard block |
||
| 69 | 69 | /** |
| 70 | 70 | * @var integer number of items contain within the list |
| 71 | 71 | */ |
| 72 | - private $_c = 0; |
|
| 72 | + private $_c=0; |
|
| 73 | 73 | /** |
| 74 | 74 | * @var numeric the default priority of items without specified priorities |
| 75 | 75 | */ |
| 76 | - private $_dp = 10; |
|
| 76 | + private $_dp=10; |
|
| 77 | 77 | /** |
| 78 | 78 | * @var integer the precision of the numeric priorities within this priority list. |
| 79 | 79 | */ |
| 80 | - private $_p = 8; |
|
| 80 | + private $_p=8; |
|
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * Constructor. |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | * @param integer the precision of the numeric priorities |
| 89 | 89 | * @throws TInvalidDataTypeException If data is not null and is neither an array nor an iterator. |
| 90 | 90 | */ |
| 91 | - public function __construct($data = null, $readOnly = false, $defaultPriority = 10, $precision = 8) |
|
| 91 | + public function __construct($data=null, $readOnly=false, $defaultPriority=10, $precision=8) |
|
| 92 | 92 | { |
| 93 | 93 | parent::__construct(); |
| 94 | - if($data !== null) |
|
| 94 | + if($data!==null) |
|
| 95 | 95 | $this->copyFrom($data); |
| 96 | 96 | $this->setReadOnly($readOnly); |
| 97 | 97 | $this->setPrecision($precision); |
@@ -122,11 +122,11 @@ discard block |
||
| 122 | 122 | * @param numeric optional priority at which to count items. if no parameter, it will be set to the default {@link getDefaultPriority} |
| 123 | 123 | * @return integer the number of items in the list at the specified priority |
| 124 | 124 | */ |
| 125 | - public function getPriorityCount($priority = null) |
|
| 125 | + public function getPriorityCount($priority=null) |
|
| 126 | 126 | { |
| 127 | - if($priority === null) |
|
| 128 | - $priority = $this->getDefaultPriority(); |
|
| 129 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 127 | + if($priority===null) |
|
| 128 | + $priority=$this->getDefaultPriority(); |
|
| 129 | + $priority=(string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 130 | 130 | |
| 131 | 131 | if(!isset($this->_d[$priority]) || !is_array($this->_d[$priority])) |
| 132 | 132 | return false; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | protected function setDefaultPriority($value) |
| 149 | 149 | { |
| 150 | - $this->_dp = (string)round(TPropertyValue::ensureFloat($value), $this->_p); |
|
| 150 | + $this->_dp=(string) round(TPropertyValue::ensureFloat($value), $this->_p); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | protected function setPrecision($value) |
| 166 | 166 | { |
| 167 | - $this->_p = TPropertyValue::ensureInteger($value); |
|
| 167 | + $this->_p=TPropertyValue::ensureInteger($value); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | protected function sortPriorities() { |
| 195 | 195 | if(!$this->_o) { |
| 196 | 196 | ksort($this->_d, SORT_NUMERIC); |
| 197 | - $this->_o = true; |
|
| 197 | + $this->_o=true; |
|
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
@@ -207,9 +207,9 @@ discard block |
||
| 207 | 207 | return $this->_fd; |
| 208 | 208 | |
| 209 | 209 | $this->sortPriorities(); |
| 210 | - $this->_fd = []; |
|
| 210 | + $this->_fd=[]; |
|
| 211 | 211 | foreach($this->_d as $priority => $itemsatpriority) |
| 212 | - $this->_fd = array_merge($this->_fd, $itemsatpriority); |
|
| 212 | + $this->_fd=array_merge($this->_fd, $itemsatpriority); |
|
| 213 | 213 | return $this->_fd; |
| 214 | 214 | } |
| 215 | 215 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | public function itemAt($index) |
| 225 | 225 | { |
| 226 | 226 | if($index >= 0 && $index < $this->getCount()) { |
| 227 | - $arr = $this->flattenPriorities(); |
|
| 227 | + $arr=$this->flattenPriorities(); |
|
| 228 | 228 | return $arr[$index]; |
| 229 | 229 | } else |
| 230 | 230 | throw new TInvalidDataValueException('list_index_invalid', $index); |
@@ -235,13 +235,13 @@ discard block |
||
| 235 | 235 | * @param numeric priority of the items to get. Defaults to null, filled in with the default priority, if left blank. |
| 236 | 236 | * @return array all items at priority in index order, null if there are no items at that priority |
| 237 | 237 | */ |
| 238 | - public function itemsAtPriority($priority = null) |
|
| 238 | + public function itemsAtPriority($priority=null) |
|
| 239 | 239 | { |
| 240 | - if($priority === null) |
|
| 241 | - $priority = $this->getDefaultPriority(); |
|
| 242 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 240 | + if($priority===null) |
|
| 241 | + $priority=$this->getDefaultPriority(); |
|
| 242 | + $priority=(string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 243 | 243 | |
| 244 | - return isset($this->_d[$priority])?$this->_d[$priority]:null; |
|
| 244 | + return isset($this->_d[$priority]) ? $this->_d[$priority] : null; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
@@ -250,14 +250,14 @@ discard block |
||
| 250 | 250 | * @param numeric the priority which to index. no parameter or null will result in the default priority |
| 251 | 251 | * @return mixed the element at the offset, false if no element is found at the offset |
| 252 | 252 | */ |
| 253 | - public function itemAtIndexInPriority($index, $priority = null) |
|
| 253 | + public function itemAtIndexInPriority($index, $priority=null) |
|
| 254 | 254 | { |
| 255 | - if($priority === null) |
|
| 256 | - $priority = $this->getDefaultPriority(); |
|
| 257 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 255 | + if($priority===null) |
|
| 256 | + $priority=$this->getDefaultPriority(); |
|
| 257 | + $priority=(string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 258 | 258 | |
| 259 | - return !isset($this->_d[$priority])?false:( |
|
| 260 | - isset($this->_d[$priority][$index])?$this->_d[$priority][$index]:false |
|
| 259 | + return !isset($this->_d[$priority]) ?false:( |
|
| 260 | + isset($this->_d[$priority][$index]) ? $this->_d[$priority][$index] : false |
|
| 261 | 261 | ); |
| 262 | 262 | } |
| 263 | 263 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | * @return int the index within the flattened array |
| 270 | 270 | * @throws TInvalidOperationException if the map is read-only |
| 271 | 271 | */ |
| 272 | - public function add($item, $priority = null) |
|
| 272 | + public function add($item, $priority=null) |
|
| 273 | 273 | { |
| 274 | 274 | if($this->getReadOnly()) |
| 275 | 275 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | if($this->getReadOnly()) |
| 291 | 291 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
| 292 | 292 | |
| 293 | - if(($priority = $this->priorityAt($index, true)) !== false) |
|
| 293 | + if(($priority=$this->priorityAt($index, true))!==false) |
|
| 294 | 294 | $this->insertAtIndexInPriority($item, $priority[1], $priority[0]); |
| 295 | 295 | else |
| 296 | 296 | throw new TInvalidDataValueException('list_index_invalid', $index); |
@@ -306,56 +306,56 @@ discard block |
||
| 306 | 306 | * @throws TInvalidDataValueException If the index specified exceeds the bound |
| 307 | 307 | * @throws TInvalidOperationException if the list is read-only |
| 308 | 308 | */ |
| 309 | - public function insertAtIndexInPriority($item, $index = false, $priority = null, $preserveCache = false) |
|
| 309 | + public function insertAtIndexInPriority($item, $index=false, $priority=null, $preserveCache=false) |
|
| 310 | 310 | { |
| 311 | 311 | if($this->getReadOnly()) |
| 312 | 312 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
| 313 | 313 | |
| 314 | - if($priority === null) |
|
| 315 | - $priority = $this->getDefaultPriority(); |
|
| 316 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 314 | + if($priority===null) |
|
| 315 | + $priority=$this->getDefaultPriority(); |
|
| 316 | + $priority=(string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 317 | 317 | |
| 318 | 318 | if($preserveCache) { |
| 319 | 319 | $this->sortPriorities(); |
| 320 | - $cc = 0; |
|
| 320 | + $cc=0; |
|
| 321 | 321 | foreach($this->_d as $prioritykey => $items) |
| 322 | 322 | if($prioritykey >= $priority) |
| 323 | 323 | break; |
| 324 | 324 | else |
| 325 | - $cc += count($items); |
|
| 325 | + $cc+=count($items); |
|
| 326 | 326 | |
| 327 | - if($index === false && isset($this->_d[$priority])) { |
|
| 328 | - $c = count($this->_d[$priority]); |
|
| 329 | - $c += $cc; |
|
| 330 | - $this->_d[$priority][] = $item; |
|
| 327 | + if($index===false && isset($this->_d[$priority])) { |
|
| 328 | + $c=count($this->_d[$priority]); |
|
| 329 | + $c+=$cc; |
|
| 330 | + $this->_d[$priority][]=$item; |
|
| 331 | 331 | } elseif(isset($this->_d[$priority])) { |
| 332 | - $c = $index + $cc; |
|
| 332 | + $c=$index + $cc; |
|
| 333 | 333 | array_splice($this->_d[$priority], $index, 0, [$item]); |
| 334 | 334 | } else { |
| 335 | - $c = $cc; |
|
| 336 | - $this->_o = false; |
|
| 337 | - $this->_d[$priority] = [$item]; |
|
| 335 | + $c=$cc; |
|
| 336 | + $this->_o=false; |
|
| 337 | + $this->_d[$priority]=[$item]; |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | if($this->_fd && is_array($this->_fd)) // if there is a flattened array cache |
| 341 | 341 | array_splice($this->_fd, $c, 0, [$item]); |
| 342 | 342 | } else { |
| 343 | - $c = null; |
|
| 344 | - if($index === false && isset($this->_d[$priority])) { |
|
| 345 | - $cc = count($this->_d[$priority]); |
|
| 346 | - $this->_d[$priority][] = $item; |
|
| 343 | + $c=null; |
|
| 344 | + if($index===false && isset($this->_d[$priority])) { |
|
| 345 | + $cc=count($this->_d[$priority]); |
|
| 346 | + $this->_d[$priority][]=$item; |
|
| 347 | 347 | } elseif(isset($this->_d[$priority])) { |
| 348 | - $cc = $index; |
|
| 348 | + $cc=$index; |
|
| 349 | 349 | array_splice($this->_d[$priority], $index, 0, [$item]); |
| 350 | 350 | } else { |
| 351 | - $cc = 0; |
|
| 352 | - $this->_o = false; |
|
| 353 | - $this->_d[$priority] = [$item]; |
|
| 351 | + $cc=0; |
|
| 352 | + $this->_o=false; |
|
| 353 | + $this->_d[$priority]=[$item]; |
|
| 354 | 354 | } |
| 355 | - if($this->_fd && is_array($this->_fd) && count($this->_d) == 1) |
|
| 355 | + if($this->_fd && is_array($this->_fd) && count($this->_d)==1) |
|
| 356 | 356 | array_splice($this->_fd, $cc, 0, [$item]); |
| 357 | 357 | else |
| 358 | - $this->_fd = null; |
|
| 358 | + $this->_fd=null; |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | $this->_c++; |
@@ -374,19 +374,19 @@ discard block |
||
| 374 | 374 | * @return integer index within the flattened list at which the item is being removed |
| 375 | 375 | * @throws TInvalidDataValueException If the item does not exist |
| 376 | 376 | */ |
| 377 | - public function remove($item, $priority = false) |
|
| 377 | + public function remove($item, $priority=false) |
|
| 378 | 378 | { |
| 379 | 379 | if($this->getReadOnly()) |
| 380 | 380 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
| 381 | 381 | |
| 382 | - if(($p = $this->priorityOf($item, true)) !== false) |
|
| 382 | + if(($p=$this->priorityOf($item, true))!==false) |
|
| 383 | 383 | { |
| 384 | - if($priority !== false) { |
|
| 385 | - if($priority === null) |
|
| 386 | - $priority = $this->getDefaultPriority(); |
|
| 387 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 384 | + if($priority!==false) { |
|
| 385 | + if($priority===null) |
|
| 386 | + $priority=$this->getDefaultPriority(); |
|
| 387 | + $priority=(string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 388 | 388 | |
| 389 | - if($p[0] != $priority) |
|
| 389 | + if($p[0]!=$priority) |
|
| 390 | 390 | throw new TInvalidDataValueException('list_item_inexistent'); |
| 391 | 391 | } |
| 392 | 392 | $this->removeAtIndexInPriority($p[1], $p[0]); |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | if($this->getReadOnly()) |
| 409 | 409 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
| 410 | 410 | |
| 411 | - if(($priority = $this->priorityAt($index, true)) !== false) |
|
| 411 | + if(($priority=$this->priorityAt($index, true))!==false) |
|
| 412 | 412 | return $this->removeAtIndexInPriority($priority[1], $priority[0]); |
| 413 | 413 | throw new TInvalidDataValueException('list_index_invalid', $index); |
| 414 | 414 | } |
@@ -421,27 +421,27 @@ discard block |
||
| 421 | 421 | * @return mixed the removed item. |
| 422 | 422 | * @throws TInvalidDataValueException If the item does not exist |
| 423 | 423 | */ |
| 424 | - public function removeAtIndexInPriority($index, $priority = null) |
|
| 424 | + public function removeAtIndexInPriority($index, $priority=null) |
|
| 425 | 425 | { |
| 426 | 426 | if($this->getReadOnly()) |
| 427 | 427 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
| 428 | 428 | |
| 429 | - if($priority === null) |
|
| 430 | - $priority = $this->getDefaultPriority(); |
|
| 431 | - $priority = (string)round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 429 | + if($priority===null) |
|
| 430 | + $priority=$this->getDefaultPriority(); |
|
| 431 | + $priority=(string) round(TPropertyValue::ensureFloat($priority), $this->_p); |
|
| 432 | 432 | |
| 433 | 433 | if(!isset($this->_d[$priority]) || $index < 0 || $index >= count($this->_d[$priority])) |
| 434 | 434 | throw new TInvalidDataValueException('list_item_inexistent'); |
| 435 | 435 | |
| 436 | 436 | // $value is an array of elements removed, only one |
| 437 | - $value = array_splice($this->_d[$priority], $index, 1); |
|
| 438 | - $value = $value[0]; |
|
| 437 | + $value=array_splice($this->_d[$priority], $index, 1); |
|
| 438 | + $value=$value[0]; |
|
| 439 | 439 | |
| 440 | 440 | if(!count($this->_d[$priority])) |
| 441 | 441 | unset($this->_d[$priority]); |
| 442 | 442 | |
| 443 | 443 | $this->_c--; |
| 444 | - $this->_fd = null; |
|
| 444 | + $this->_fd=null; |
|
| 445 | 445 | return $value; |
| 446 | 446 | } |
| 447 | 447 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
| 455 | 455 | |
| 456 | 456 | foreach($this->_d as $priority => $items) { |
| 457 | - for($index = count($items) - 1;$index >= 0;$index--) |
|
| 457 | + for($index=count($items) - 1; $index >= 0; $index--) |
|
| 458 | 458 | $this->removeAtIndexInPriority($index, $priority); |
| 459 | 459 | unset($this->_d[$priority]); |
| 460 | 460 | } |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | */ |
| 476 | 476 | public function indexOf($item) |
| 477 | 477 | { |
| 478 | - if(($index = array_search($item, $this->flattenPriorities(), true)) === false) |
|
| 478 | + if(($index=array_search($item, $this->flattenPriorities(), true))===false) |
|
| 479 | 479 | return -1; |
| 480 | 480 | else |
| 481 | 481 | return $index; |
@@ -490,18 +490,18 @@ discard block |
||
| 490 | 490 | * if withindex is true, an array is returned of [0 => $priority, 1 => $priorityIndex, 2 => flattenedIndex, |
| 491 | 491 | * 'priority' => $priority, 'index' => $priorityIndex, 'absindex' => flattenedIndex] |
| 492 | 492 | */ |
| 493 | - public function priorityOf($item, $withindex = false) |
|
| 493 | + public function priorityOf($item, $withindex=false) |
|
| 494 | 494 | { |
| 495 | 495 | $this->sortPriorities(); |
| 496 | 496 | |
| 497 | - $absindex = 0; |
|
| 497 | + $absindex=0; |
|
| 498 | 498 | foreach($this->_d as $priority => $items) { |
| 499 | - if(($index = array_search($item, $items, true)) !== false) { |
|
| 500 | - $absindex += $index; |
|
| 501 | - return $withindex?[$priority,$index,$absindex, |
|
| 502 | - 'priority' => $priority,'index' => $index,'absindex' => $absindex]:$priority; |
|
| 499 | + if(($index=array_search($item, $items, true))!==false) { |
|
| 500 | + $absindex+=$index; |
|
| 501 | + return $withindex ? [$priority, $index, $absindex, |
|
| 502 | + 'priority' => $priority, 'index' => $index, 'absindex' => $absindex] : $priority; |
|
| 503 | 503 | } else |
| 504 | - $absindex += count($items); |
|
| 504 | + $absindex+=count($items); |
|
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | return false; |
@@ -516,19 +516,19 @@ discard block |
||
| 516 | 516 | * if withindex is true, an array is returned of [0 => $priority, 1 => $priorityIndex, 2 => flattenedIndex, |
| 517 | 517 | * 'priority' => $priority, 'index' => $priorityIndex, 'absindex' => flattenedIndex] |
| 518 | 518 | */ |
| 519 | - public function priorityAt($index, $withindex = false) |
|
| 519 | + public function priorityAt($index, $withindex=false) |
|
| 520 | 520 | { |
| 521 | 521 | if($index < 0 || $index >= $this->getCount()) |
| 522 | 522 | throw new TInvalidDataValueException('list_index_invalid', $index); |
| 523 | 523 | |
| 524 | - $absindex = $index; |
|
| 524 | + $absindex=$index; |
|
| 525 | 525 | $this->sortPriorities(); |
| 526 | 526 | foreach($this->_d as $priority => $items) { |
| 527 | - if($index >= ($c = count($items))) |
|
| 528 | - $index -= $c; |
|
| 527 | + if($index >= ($c=count($items))) |
|
| 528 | + $index-=$c; |
|
| 529 | 529 | else |
| 530 | - return $withindex?[$priority,$index,$absindex, |
|
| 531 | - 'priority' => $priority,'index' => $index,'absindex' => $absindex]:$priority; |
|
| 530 | + return $withindex ? [$priority, $index, $absindex, |
|
| 531 | + 'priority' => $priority, 'index' => $index, 'absindex' => $absindex] : $priority; |
|
| 532 | 532 | } |
| 533 | 533 | return false; |
| 534 | 534 | } |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | if($this->getReadOnly()) |
| 547 | 547 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
| 548 | 548 | |
| 549 | - if(($priority = $this->priorityOf($indexitem, true)) === false) |
|
| 549 | + if(($priority=$this->priorityOf($indexitem, true))===false) |
|
| 550 | 550 | throw new TInvalidDataValueException('list_item_inexistent'); |
| 551 | 551 | |
| 552 | 552 | $this->insertAtIndexInPriority($item, $priority[1], $priority[0]); |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | if($this->getReadOnly()) |
| 568 | 568 | throw new TInvalidOperationException('list_readonly', get_class($this)); |
| 569 | 569 | |
| 570 | - if(($priority = $this->priorityOf($indexitem, true)) === false) |
|
| 570 | + if(($priority=$this->priorityOf($indexitem, true))===false) |
|
| 571 | 571 | throw new TInvalidDataValueException('list_item_inexistent'); |
| 572 | 572 | |
| 573 | 573 | $this->insertAtIndexInPriority($item, $priority[1] + 1, $priority[0]); |
@@ -599,15 +599,15 @@ discard block |
||
| 599 | 599 | * @return array the array of priorities keys with values of arrays of items that are below a specified priority. |
| 600 | 600 | * The priorities are sorted so important priorities, lower numerics, are first. |
| 601 | 601 | */ |
| 602 | - public function toArrayBelowPriority($priority, $inclusive = false) |
|
| 602 | + public function toArrayBelowPriority($priority, $inclusive=false) |
|
| 603 | 603 | { |
| 604 | 604 | $this->sortPriorities(); |
| 605 | - $items = []; |
|
| 605 | + $items=[]; |
|
| 606 | 606 | foreach($this->_d as $itemspriority => $itemsatpriority) |
| 607 | 607 | { |
| 608 | 608 | if((!$inclusive && $itemspriority >= $priority) || $itemspriority > $priority) |
| 609 | 609 | break; |
| 610 | - $items = array_merge($items, $itemsatpriority); |
|
| 610 | + $items=array_merge($items, $itemsatpriority); |
|
| 611 | 611 | } |
| 612 | 612 | return $items; |
| 613 | 613 | } |
@@ -619,15 +619,15 @@ discard block |
||
| 619 | 619 | * @return array the array of priorities keys with values of arrays of items that are above a specified priority. |
| 620 | 620 | * The priorities are sorted so important priorities, lower numerics, are first. |
| 621 | 621 | */ |
| 622 | - public function toArrayAbovePriority($priority, $inclusive = true) |
|
| 622 | + public function toArrayAbovePriority($priority, $inclusive=true) |
|
| 623 | 623 | { |
| 624 | 624 | $this->sortPriorities(); |
| 625 | - $items = []; |
|
| 625 | + $items=[]; |
|
| 626 | 626 | foreach($this->_d as $itemspriority => $itemsatpriority) |
| 627 | 627 | { |
| 628 | 628 | if((!$inclusive && $itemspriority <= $priority) || $itemspriority < $priority) |
| 629 | 629 | continue; |
| 630 | - $items = array_merge($items, $itemsatpriority); |
|
| 630 | + $items=array_merge($items, $itemsatpriority); |
|
| 631 | 631 | } |
| 632 | 632 | return $items; |
| 633 | 633 | } |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | $this->clear(); |
| 656 | 656 | foreach($data as $key => $item) |
| 657 | 657 | $this->add($item); |
| 658 | - } elseif($data !== null) |
|
| 658 | + } elseif($data!==null) |
|
| 659 | 659 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 660 | 660 | } |
| 661 | 661 | |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | $this->add($item); |
| 684 | 684 | |
| 685 | 685 | } |
| 686 | - elseif($data !== null) |
|
| 686 | + elseif($data!==null) |
|
| 687 | 687 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 688 | 688 | } |
| 689 | 689 | |
@@ -723,13 +723,13 @@ discard block |
||
| 723 | 723 | */ |
| 724 | 724 | public function offsetSet($offset, $item) |
| 725 | 725 | { |
| 726 | - if($offset === null) |
|
| 726 | + if($offset===null) |
|
| 727 | 727 | return $this->add($item); |
| 728 | - if($offset === $this->getCount()) { |
|
| 729 | - $priority = $this->priorityAt($offset - 1, true); |
|
| 728 | + if($offset===$this->getCount()) { |
|
| 729 | + $priority=$this->priorityAt($offset - 1, true); |
|
| 730 | 730 | $priority[1]++; |
| 731 | 731 | } else { |
| 732 | - $priority = $this->priorityAt($offset, true); |
|
| 732 | + $priority=$this->priorityAt($offset, true); |
|
| 733 | 733 | $this->removeAtIndexInPriority($priority[1], $priority[0]); |
| 734 | 734 | } |
| 735 | 735 | $this->insertAtIndexInPriority($item, $priority[1], $priority[0]); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct($oldPage) |
| 33 | 33 | { |
| 34 | - $this->_oldPage = $oldPage; |
|
| 34 | + $this->_oldPage=$oldPage; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -47,16 +47,16 @@ discard block |
||
| 47 | 47 | * internal data storage |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - private $_d = []; |
|
| 50 | + private $_d=[]; |
|
| 51 | 51 | /** |
| 52 | 52 | * number of items |
| 53 | 53 | * @var integer |
| 54 | 54 | */ |
| 55 | - private $_c = 0; |
|
| 55 | + private $_c=0; |
|
| 56 | 56 | /** |
| 57 | 57 | * @var boolean whether this list is read-only |
| 58 | 58 | */ |
| 59 | - private $_r = false; |
|
| 59 | + private $_r=false; |
|
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Constructor. |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | * @param boolean whether the list is read-only |
| 66 | 66 | * @throws TInvalidDataTypeException If data is not null and neither an array nor an iterator. |
| 67 | 67 | */ |
| 68 | - public function __construct($data = null, $readOnly = false) |
|
| 68 | + public function __construct($data=null, $readOnly=false) |
|
| 69 | 69 | { |
| 70 | - if($data !== null) |
|
| 70 | + if($data!==null) |
|
| 71 | 71 | $this->copyFrom($data); |
| 72 | 72 | $this->setReadOnly($readOnly); |
| 73 | 73 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | protected function setReadOnly($value) |
| 87 | 87 | { |
| 88 | - $this->_r = TPropertyValue::ensureBoolean($value); |
|
| 88 | + $this->_r=TPropertyValue::ensureBoolean($value); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -156,8 +156,8 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | if(!$this->_r) |
| 158 | 158 | { |
| 159 | - if($index === $this->_c) |
|
| 160 | - $this->_d[$this->_c++] = $item; |
|
| 159 | + if($index===$this->_c) |
|
| 160 | + $this->_d[$this->_c++]=$item; |
|
| 161 | 161 | elseif($index >= 0 && $index < $this->_c) |
| 162 | 162 | { |
| 163 | 163 | array_splice($this->_d, $index, 0, [$item]); |
@@ -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; |
@@ -209,11 +209,11 @@ discard block |
||
| 209 | 209 | if($index >= 0 && $index < $this->_c) |
| 210 | 210 | { |
| 211 | 211 | $this->_c--; |
| 212 | - if($index === $this->_c) |
|
| 212 | + if($index===$this->_c) |
|
| 213 | 213 | return array_pop($this->_d); |
| 214 | 214 | else |
| 215 | 215 | { |
| 216 | - $item = $this->_d[$index]; |
|
| 216 | + $item=$this->_d[$index]; |
|
| 217 | 217 | array_splice($this->_d, $index, 1); |
| 218 | 218 | return $item; |
| 219 | 219 | } |
@@ -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 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public function indexOf($item) |
| 252 | 252 | { |
| 253 | - if(($index = array_search($item, $this->_d, true)) === false) |
|
| 253 | + if(($index=array_search($item, $this->_d, true))===false) |
|
| 254 | 254 | return -1; |
| 255 | 255 | else |
| 256 | 256 | return $index; |
@@ -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); |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | foreach($data as $item) |
| 328 | 328 | $this->add($item); |
| 329 | 329 | } |
| 330 | - elseif($data !== null) |
|
| 330 | + elseif($data!==null) |
|
| 331 | 331 | throw new TInvalidDataTypeException('list_data_not_iterable'); |
| 332 | 332 | } |
| 333 | 333 | |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | foreach($data as $item) |
| 345 | 345 | $this->add($item); |
| 346 | 346 | } |
| 347 | - elseif($data !== null) |
|
| 347 | + elseif($data!==null) |
|
| 348 | 348 | throw new TInvalidDataTypeException('list_data_not_iterable'); |
| 349 | 349 | } |
| 350 | 350 | |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | */ |
| 380 | 380 | public function offsetSet($offset, $item) |
| 381 | 381 | { |
| 382 | - if($offset === null || $offset === $this->_c) |
|
| 382 | + if($offset===null || $offset===$this->_c) |
|
| 383 | 383 | $this->insertAt($this->_c, $item); |
| 384 | 384 | else |
| 385 | 385 | { |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function __construct($count) |
| 38 | 38 | { |
| 39 | - $this->_count = $count; |
|
| 39 | + $this->_count=$count; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function __construct($count) |
| 37 | 37 | { |
| 38 | - $this->_count = $count; |
|
| 39 | - $this->_index = 0; |
|
| 38 | + $this->_count=$count; |
|
| 39 | + $this->_index=0; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function rewind() |
| 47 | 47 | { |
| 48 | - $this->_index = 0; |
|
| 48 | + $this->_index=0; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * @var array internal data storage |
| 44 | 44 | */ |
| 45 | - private $_d = []; |
|
| 45 | + private $_d=[]; |
|
| 46 | 46 | /** |
| 47 | 47 | * @var boolean whether this list is read-only |
| 48 | 48 | */ |
| 49 | - private $_r = false; |
|
| 49 | + private $_r=false; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Returns an array with the names of all variables of this object that should NOT be serialized |
@@ -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 | /** |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | * @param boolean whether the list is read-only |
| 71 | 71 | * @throws TInvalidDataTypeException If data is not null and neither an array nor an iterator. |
| 72 | 72 | */ |
| 73 | - public function __construct($data = null, $readOnly = false) |
|
| 73 | + public function __construct($data=null, $readOnly=false) |
|
| 74 | 74 | { |
| 75 | - if($data !== null) |
|
| 75 | + if($data!==null) |
|
| 76 | 76 | $this->copyFrom($data); |
| 77 | 77 | $this->setReadOnly($readOnly); |
| 78 | 78 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | protected function setReadOnly($value) |
| 92 | 92 | { |
| 93 | - $this->_r = TPropertyValue::ensureBoolean($value); |
|
| 93 | + $this->_r=TPropertyValue::ensureBoolean($value); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | public function add($key, $value) |
| 151 | 151 | { |
| 152 | 152 | if(!$this->_r) |
| 153 | - $this->_d[$key] = $value; |
|
| 153 | + $this->_d[$key]=$value; |
|
| 154 | 154 | else |
| 155 | 155 | throw new TInvalidOperationException('map_readonly', get_class($this)); |
| 156 | 156 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | { |
| 168 | 168 | if(isset($this->_d[$key]) || array_key_exists($key, $this->_d)) |
| 169 | 169 | { |
| 170 | - $value = $this->_d[$key]; |
|
| 170 | + $value=$this->_d[$key]; |
|
| 171 | 171 | unset($this->_d[$key]); |
| 172 | 172 | return $value; |
| 173 | 173 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | foreach($data as $key => $value) |
| 220 | 220 | $this->add($key, $value); |
| 221 | 221 | } |
| 222 | - elseif($data !== null) |
|
| 222 | + elseif($data!==null) |
|
| 223 | 223 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 224 | 224 | } |
| 225 | 225 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | foreach($data as $key => $value) |
| 237 | 237 | $this->add($key, $value); |
| 238 | 238 | } |
| 239 | - elseif($data !== null) |
|
| 239 | + elseif($data!==null) |
|
| 240 | 240 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 241 | 241 | } |
| 242 | 242 | |
@@ -37,14 +37,14 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function __construct(TMap $map, $startIndex, $count) |
| 39 | 39 | { |
| 40 | - $this->_map = $map; |
|
| 41 | - $this->_index = 0; |
|
| 42 | - $this->_startIndex = $startIndex; |
|
| 40 | + $this->_map=$map; |
|
| 41 | + $this->_index=0; |
|
| 42 | + $this->_startIndex=$startIndex; |
|
| 43 | 43 | if($startIndex + $count > $map->getCount()) |
| 44 | - $this->_count = $map->getCount() - $startIndex; |
|
| 44 | + $this->_count=$map->getCount() - $startIndex; |
|
| 45 | 45 | else |
| 46 | - $this->_count = $count; |
|
| 47 | - $this->_iterator = $map->getIterator(); |
|
| 46 | + $this->_count=$count; |
|
| 47 | + $this->_iterator=$map->getIterator(); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | public function rewind() |
| 55 | 55 | { |
| 56 | 56 | $this->_iterator->rewind(); |
| 57 | - for($i = 0;$i < $this->_startIndex;++$i) |
|
| 57 | + for($i=0; $i < $this->_startIndex; ++$i) |
|
| 58 | 58 | $this->_iterator->next(); |
| 59 | - $this->_index = 0; |
|
| 59 | + $this->_index=0; |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function __construct(&$data) |
| 46 | 46 | { |
| 47 | - $this->_d = &$data; |
|
| 48 | - $this->_i = 0; |
|
| 49 | - $this->_c = count($this->_d); |
|
| 47 | + $this->_d=&$data; |
|
| 48 | + $this->_i=0; |
|
| 49 | + $this->_c=count($this->_d); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function rewind() |
| 57 | 57 | { |
| 58 | - $this->_i = 0; |
|
| 58 | + $this->_i=0; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |