----------------------------------------------------------------------
()
| 337 | |
| 338 | //---------------------------------------------------------------------- |
| 339 | public function next() |
| 340 | { |
| 341 | do { |
| 342 | |
| 343 | if($this->bit == -1) { |
| 344 | $this->bit = 0; |
| 345 | return array('x'=>$this->x, 'y'=>$this->y); |
| 346 | } |
| 347 | |
| 348 | $x = $this->x; |
| 349 | $y = $this->y; |
| 350 | $w = $this->width; |
| 351 | |
| 352 | if($this->bit == 0) { |
| 353 | $x--; |
| 354 | $this->bit++; |
| 355 | } else { |
| 356 | $x++; |
| 357 | $y += $this->dir; |
| 358 | $this->bit--; |
| 359 | } |
| 360 | |
| 361 | if($this->dir < 0) { |
| 362 | if($y < 0) { |
| 363 | $y = 0; |
| 364 | $x -= 2; |
| 365 | $this->dir = 1; |
| 366 | if($x == 6) { |
| 367 | $x--; |
| 368 | $y = 9; |
| 369 | } |
| 370 | } |
| 371 | } else { |
| 372 | if($y == $w) { |
| 373 | $y = $w - 1; |
| 374 | $x -= 2; |
| 375 | $this->dir = -1; |
| 376 | if($x == 6) { |
| 377 | $x--; |
| 378 | $y -= 8; |
| 379 | } |
| 380 | } |
| 381 | } |
| 382 | if($x < 0 || $y < 0) return null; |
| 383 | |
| 384 | $this->x = $x; |
| 385 | $this->y = $y; |
| 386 | |
| 387 | } while(ord($this->frame[$y][$x]) & 0x80); |
| 388 | |
| 389 | return array('x'=>$x, 'y'=>$y); |
| 390 | } |
| 391 | |
| 392 | } ; |
| 393 |
no outgoing calls
no test coverage detected