Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 25011f8

Browse files
committed
Deprecate EmptyContextInterface, InputInterface::setAllowEmpty & allowEmpty
Deprecate magic logic for auto attach a NonEmpty validator with break on failure = true
1 parent b75c2a7 commit 25011f8

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

src/EmptyContextInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@
99

1010
namespace Zend\InputFilter;
1111

12+
/**
13+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
14+
*/
1215
interface EmptyContextInterface
1316
{
1417
/**
18+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
19+
*
1520
* @param bool $continueIfEmpty
1621
* @return self
1722
*/
1823
public function setContinueIfEmpty($continueIfEmpty);
1924

2025
/**
26+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
27+
*
2128
* @return bool
2229
*/
2330
public function continueIfEmpty();

src/FileInput.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ protected function injectUploadValidator()
181181
}
182182

183183
/**
184+
* @deprecated 2.5.5 See note on parent class. Removal does not affect this class.
185+
*
184186
* No-op, NotEmpty validator does not apply for FileInputs.
185187
* See also: BaseInputFilter::isValid()
186188
*

src/Input.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ class Input implements
1818
EmptyContextInterface
1919
{
2020
/**
21+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
22+
*
2123
* @var bool
2224
*/
2325
protected $allowEmpty = false;
2426

2527
/**
28+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
29+
*
2630
* @var bool
2731
*/
2832
protected $continueIfEmpty = false;
@@ -48,6 +52,8 @@ class Input implements
4852
protected $name;
4953

5054
/**
55+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
56+
*
5157
* @var bool
5258
*/
5359
protected $notEmptyValidator = false;
@@ -83,6 +89,8 @@ public function __construct($name = null)
8389
}
8490

8591
/**
92+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
93+
*
8694
* @param bool $allowEmpty
8795
* @return Input
8896
*/
@@ -103,6 +111,8 @@ public function setBreakOnFailure($breakOnFailure)
103111
}
104112

105113
/**
114+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
115+
*
106116
* @param bool $continueIfEmpty
107117
* @return Input
108118
*/
@@ -184,6 +194,8 @@ public function setFallbackValue($value)
184194
}
185195

186196
/**
197+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
198+
*
187199
* @return bool
188200
*/
189201
public function allowEmpty()
@@ -200,6 +212,8 @@ public function breakOnFailure()
200212
}
201213

202214
/**
215+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
216+
*
203217
* @return bool
204218
*/
205219
public function continueIfEmpty()
@@ -370,6 +384,8 @@ public function getMessages()
370384
}
371385

372386
/**
387+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
388+
*
373389
* @return void
374390
*/
375391
protected function injectNotEmptyValidator()

src/InputInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
interface InputInterface
1616
{
1717
/**
18+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
19+
*
1820
* @param bool $allowEmpty
1921
* @return self
2022
*/
@@ -69,6 +71,8 @@ public function setValue($value);
6971
public function merge(InputInterface $input);
7072

7173
/**
74+
* @deprecated 2.5.5 Add Zend\Validator\NotEmpty validator to the ValidatorChain.
75+
*
7276
* @return bool
7377
*/
7478
public function allowEmpty();

0 commit comments

Comments
 (0)