src/Combinatorics.php 1 location
|
@@ 54-60 (lines=7) @@
|
| 51 |
|
* |
| 52 |
|
* @return $this |
| 53 |
|
*/ |
| 54 |
|
public function setLength($length = null) |
| 55 |
|
{ |
| 56 |
|
$length = (null === $length) ? $this->datasetCount : $length; |
| 57 |
|
$this->length = ($length > $this->datasetCount) ? $this->datasetCount : $length; |
| 58 |
|
|
| 59 |
|
return $this; |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
/** |
| 63 |
|
* Get the length. |
src/Iterators/Shift.php 1 location
|
@@ 44-50 (lines=7) @@
|
| 41 |
|
/** |
| 42 |
|
* {@inheritdoc} |
| 43 |
|
*/ |
| 44 |
|
public function setLength($length = null) |
| 45 |
|
{ |
| 46 |
|
$length = (null === $length) ? $this->datasetCount : $length; |
| 47 |
|
$this->length = (abs($length) > $this->datasetCount) ? $this->datasetCount : $length; |
| 48 |
|
|
| 49 |
|
return $this; |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
/** |
| 53 |
|
* {@inheritdoc} |