Skip to content

Commit d73a078

Browse files
committed
refactor(docblocks): document public apis/methods
1 parent ee2cc96 commit d73a078

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Validator.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,29 @@
2020
*/
2121
class Validator
2222
{
23+
/**
24+
* Check if the value is in range of given offset.
25+
*
26+
* @param int $value
27+
* @param string $offset
28+
*
29+
* @return bool
30+
*/
2331
public function inRange($value, $offset)
2432
{
2533
$parts = \explode('-', $offset);
2634

2735
return $parts[0] <= $value && $value <= $parts[1];
2836
}
2937

38+
/**
39+
* Check if the value is in step of given offset.
40+
*
41+
* @param int $value
42+
* @param string $offset
43+
*
44+
* @return bool
45+
*/
3046
public function inStep($value, $offset)
3147
{
3248
$parts = \explode('/', $offset, 2);
@@ -45,6 +61,16 @@ public function inStep($value, $offset)
4561
return $this->inStepRange($value, $subparts[0], $subparts[1], $parts[1]);
4662
}
4763

64+
/**
65+
* Check if the value falls between start and end when advanved by step.
66+
*
67+
* @param int $value
68+
* @param int $start
69+
* @param int $end
70+
* @param int $step
71+
*
72+
* @return bool
73+
*/
4874
public function inStepRange($value, $start, $end, $step)
4975
{
5076
if (($start + $step) > $end) {

0 commit comments

Comments
 (0)