-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a few classes the will be present in the next version
This commit will deprecate some classes in favor of a couple of news ones. If there are no customisations to `assert()`, `check()`, and other methods, the migration should be pretty easy on users.
- Loading branch information
1 parent
ac5ef7f
commit 01a127a
Showing
11 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ | |
* @author Alexandre Gomes Gaigalas <[email protected]> | ||
* @author Henrique Moody <[email protected]> | ||
* @author Wojciech Frącz <[email protected]> | ||
* | ||
* @deprecated This class is deprecated, and will be removed in the next major version. Use {@see Composite} instead. | ||
*/ | ||
abstract class AbstractComposite extends AbstractRule | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
* having an custom message. | ||
* | ||
* @author Henrique Moody <[email protected]> | ||
* | ||
* @deprecated This class is deprecated, and will be removed in the next major version. Use {@see Envelope} instead. | ||
*/ | ||
abstract class AbstractEnvelope extends AbstractRule | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
* @author Henrique Moody <[email protected]> | ||
* @author Nick Lombard <[email protected]> | ||
* @author Vicente Mendoza <[email protected]> | ||
* | ||
* @deprecated This class is deprecated, and will be removed in the next major version. Use {@see Simple} instead. | ||
*/ | ||
abstract class AbstractRule implements Validatable | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
* | ||
* @author Alasdair North <[email protected]> | ||
* @author Henrique Moody <[email protected]> | ||
* | ||
* @deprecated This class is deprecated, and will be removed in the next major version. Use {@see Wrapper} instead. | ||
*/ | ||
abstract class AbstractWrapper extends AbstractRule | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Respect\Validation\Rules\Core; | ||
|
||
use Respect\Validation\Rules\AbstractComposite; | ||
use Respect\Validation\Validatable; | ||
|
||
abstract class Composite extends AbstractComposite | ||
{ | ||
public function __construct(Validatable $rule1, Validatable $rule2, Validatable ...$rules) | ||
{ | ||
parent::__construct($rule1, $rule2, ...$rules); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Respect\Validation\Rules\Core; | ||
|
||
use Respect\Validation\Rules\AbstractEnvelope; | ||
|
||
abstract class Envelope extends AbstractEnvelope | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Respect\Validation\Rules\Core; | ||
|
||
use Respect\Validation\Rules\AbstractRule; | ||
|
||
abstract class Simple extends AbstractRule | ||
{ | ||
abstract public function isValid(mixed $input): bool; | ||
|
||
/** | ||
* @deprecated Calling `validate()` directly from rules is deprecated. Please use {@see Validator::isValid()} instead. | ||
*/ | ||
public function validate($input): bool | ||
{ | ||
return $this->isValid($input); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Respect\Validation\Rules\Core; | ||
|
||
use Respect\Validation\Rules\AbstractWrapper; | ||
|
||
abstract class Wrapper extends AbstractWrapper | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters