Skip to content

Commit

Permalink
調整
Browse files Browse the repository at this point in the history
  • Loading branch information
tokushima committed Jul 8, 2023
1 parent c9da2dc commit 8537c36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions lib/ebi/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ class Paginator implements \IteratorAggregate{

public function getIterator(): \Traversable{
return new \ArrayIterator([
'current'=>$this->current()
,'limit'=>$this->limit()
,'offset'=>$this->offset()
,'total'=>$this->total()
,'order'=>$this->order()
'current'=>$this->current(),
'pages'=>ceil($this->total() / $this->limit()),
'limit'=>$this->limit(),
'offset'=>$this->offset(),
'total'=>$this->total(),
'order'=>$this->order(),
]);
}
/**
Expand Down
2 changes: 1 addition & 1 deletion lib/ebi/ZipArchive.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function __destruct(){

/**
* 書き出す
* @return 書き出したZIPファイルパス
* @return string 書き出したZIPファイルパス
*/
public function write(): string{
if (!$this->wrote) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test/ebi/Paginator/getIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
$p->total(100);
$re = [];
foreach($p as $k => $v) $re[$k] = $v;
eq(array('current'=>3,'limit'=>10,'offset'=>20,'total'=>100,'order'=>null),$re);
eq(array('current'=>3,'pages'=>10,'limit'=>10,'offset'=>20,'total'=>100,'order'=>null),$re);

0 comments on commit 8537c36

Please sign in to comment.