Code Duplication    Length = 9-12 lines in 2 locations

PHPDaemon/FS/File.php 2 locations

@@ 576-587 (lines=12) @@
573
			}
574
			return false;
575
		}
576
		$this->statRefresh(function ($file, $stat) use ($cb, $pri) {
577
			if (!$stat) {
578
				if ($cb) {
579
					$cb($file, false);
580
				}
581
				return;
582
			}
583
			$offset = 0;
584
			$buf    = '';
585
			$size   = $stat['size'];
586
			eio_read($file->fd, min($file->chunkSize, $size), 0, $pri, $this->readAllGenHandler($cb, $size, $offset, $pri, $buf), $file);
587
		}, $pri);
588
		return true;
589
	}
590
@@ 628-636 (lines=9) @@
625
			}
626
			return false;
627
		}
628
		return $this->statRefresh(function ($file, $stat) use ($cb, $chunkcb, $pri) {
629
			if (!$stat) {
630
				$cb($file, false);
631
				return;
632
			}
633
			$offset = 0;
634
			$size   = $stat['size'];
635
			eio_read($file->fd, min($file->chunkSize, $size), $offset, $pri, $this->readAllChunkedGenHandler($cb, $chunkcb, $size, $offset, $pri), $file);
636
		}, $pri);
637
	}
638
639
	/**