Skip to content

Commit

Permalink
Don't extend depcreated interfaces - do it the other way around
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Mar 12, 2020
1 parent 24272f1 commit 89b5e94
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 68 deletions.
51 changes: 50 additions & 1 deletion src/Contract/Paginatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,55 @@

namespace ipl\Stdlib\Contract;

interface Paginatable extends PaginationInterface
use Countable;

interface Paginatable extends Countable
{
/**
* Get whether a limit is set
*
* @return bool
*/
public function hasLimit();

/**
* Get the limit
*
* @return int|null
*/
public function getLimit();

/**
* Set the limit
*
* @param int|null $limit Maximum number of items to return. If you want to disable the limit,
* it is best practice to use null or a negative value
*
* @return $this
*/
public function limit($limit);

/**
* Get whether an offset is set
*
* @return bool
*/
public function hasOffset();

/**
* Get the offset
*
* @return int|null
*/
public function getOffset();

/**
* Set the offset
*
* @param int|null $offset Start result set after this many rows. If you want to disable the offset,
* it is best practice to use null or a negative value
*
* @return $this
*/
public function offset($offset);
}
51 changes: 1 addition & 50 deletions src/Contract/PaginationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,7 @@

namespace ipl\Stdlib\Contract;

use Countable;

/** @deprecated Use {@link Paginatable} instead */
interface PaginationInterface extends Countable
interface PaginationInterface extends Paginatable
{
/**
* Get whether a limit is set
*
* @return bool
*/
public function hasLimit();

/**
* Get the limit
*
* @return int|null
*/
public function getLimit();

/**
* Set the limit
*
* @param int|null $limit Maximum number of items to return. If you want to disable the limit,
* it is best practice to use null or a negative value
*
* @return $this
*/
public function limit($limit);

/**
* Get whether an offset is set
*
* @return bool
*/
public function hasOffset();

/**
* Get the offset
*
* @return int|null
*/
public function getOffset();

/**
* Set the offset
*
* @param int|null $offset Start result set after this many rows. If you want to disable the offset,
* it is best practice to use null or a negative value
*
* @return $this
*/
public function offset($offset);
}
17 changes: 16 additions & 1 deletion src/Contract/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

namespace ipl\Stdlib\Contract;

interface Validator extends ValidatorInterface
interface Validator
{
/**
* Get whether the given value is valid
*
* @param mixed $value
*
* @return bool
*/
public function isValid($value);

/**
* Get the validation error messages
*
* @return array
*/
public function getMessages();
}
17 changes: 1 addition & 16 deletions src/Contract/ValidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,6 @@
namespace ipl\Stdlib\Contract;

/** @deprecated Use {@link Validator} instead */
interface ValidatorInterface
interface ValidatorInterface extends Validator
{
/**
* Get whether the given value is valid
*
* @param mixed $value
*
* @return bool
*/
public function isValid($value);

/**
* Get the validation error messages
*
* @return array
*/
public function getMessages();
}

0 comments on commit 89b5e94

Please sign in to comment.