Skip to content

Commit 89b5e94

Browse files
committed
Don't extend depcreated interfaces - do it the other way around
1 parent 24272f1 commit 89b5e94

File tree

4 files changed

+68
-68
lines changed

4 files changed

+68
-68
lines changed

src/Contract/Paginatable.php

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,55 @@
22

33
namespace ipl\Stdlib\Contract;
44

5-
interface Paginatable extends PaginationInterface
5+
use Countable;
6+
7+
interface Paginatable extends Countable
68
{
9+
/**
10+
* Get whether a limit is set
11+
*
12+
* @return bool
13+
*/
14+
public function hasLimit();
15+
16+
/**
17+
* Get the limit
18+
*
19+
* @return int|null
20+
*/
21+
public function getLimit();
22+
23+
/**
24+
* Set the limit
25+
*
26+
* @param int|null $limit Maximum number of items to return. If you want to disable the limit,
27+
* it is best practice to use null or a negative value
28+
*
29+
* @return $this
30+
*/
31+
public function limit($limit);
32+
33+
/**
34+
* Get whether an offset is set
35+
*
36+
* @return bool
37+
*/
38+
public function hasOffset();
39+
40+
/**
41+
* Get the offset
42+
*
43+
* @return int|null
44+
*/
45+
public function getOffset();
46+
47+
/**
48+
* Set the offset
49+
*
50+
* @param int|null $offset Start result set after this many rows. If you want to disable the offset,
51+
* it is best practice to use null or a negative value
52+
*
53+
* @return $this
54+
*/
55+
public function offset($offset);
756
}

src/Contract/PaginationInterface.php

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,7 @@
22

33
namespace ipl\Stdlib\Contract;
44

5-
use Countable;
6-
75
/** @deprecated Use {@link Paginatable} instead */
8-
interface PaginationInterface extends Countable
6+
interface PaginationInterface extends Paginatable
97
{
10-
/**
11-
* Get whether a limit is set
12-
*
13-
* @return bool
14-
*/
15-
public function hasLimit();
16-
17-
/**
18-
* Get the limit
19-
*
20-
* @return int|null
21-
*/
22-
public function getLimit();
23-
24-
/**
25-
* Set the limit
26-
*
27-
* @param int|null $limit Maximum number of items to return. If you want to disable the limit,
28-
* it is best practice to use null or a negative value
29-
*
30-
* @return $this
31-
*/
32-
public function limit($limit);
33-
34-
/**
35-
* Get whether an offset is set
36-
*
37-
* @return bool
38-
*/
39-
public function hasOffset();
40-
41-
/**
42-
* Get the offset
43-
*
44-
* @return int|null
45-
*/
46-
public function getOffset();
47-
48-
/**
49-
* Set the offset
50-
*
51-
* @param int|null $offset Start result set after this many rows. If you want to disable the offset,
52-
* it is best practice to use null or a negative value
53-
*
54-
* @return $this
55-
*/
56-
public function offset($offset);
578
}

src/Contract/Validator.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
namespace ipl\Stdlib\Contract;
44

5-
interface Validator extends ValidatorInterface
5+
interface Validator
66
{
7+
/**
8+
* Get whether the given value is valid
9+
*
10+
* @param mixed $value
11+
*
12+
* @return bool
13+
*/
14+
public function isValid($value);
15+
16+
/**
17+
* Get the validation error messages
18+
*
19+
* @return array
20+
*/
21+
public function getMessages();
722
}

src/Contract/ValidatorInterface.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,6 @@
33
namespace ipl\Stdlib\Contract;
44

55
/** @deprecated Use {@link Validator} instead */
6-
interface ValidatorInterface
6+
interface ValidatorInterface extends Validator
77
{
8-
/**
9-
* Get whether the given value is valid
10-
*
11-
* @param mixed $value
12-
*
13-
* @return bool
14-
*/
15-
public function isValid($value);
16-
17-
/**
18-
* Get the validation error messages
19-
*
20-
* @return array
21-
*/
22-
public function getMessages();
238
}

0 commit comments

Comments
 (0)