Re: [RFC][VOTE] Add validation functions to filter module
| From: | Lester Caine | Date: | Wed, 07 Sep 2016 09:50:34 +0000 |
| Subject: | Re: [RFC][VOTE] Add validation functions to filter module | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95726@lists.php.net to get a copy of this message | ||
On 07/09/16 10:19, Lester Caine wrote:
> If the definition of a variable is
> improved to include ALL of the validation we ideally need and I include
> setStrict(int) in that then at run time we can both validate input and
> decide on the error model that is applied.
And I know I will get my head chewed of for combining threads, but
readOnly(); Seems to me the correct answer to the whole of the
'immutable' debate. The class simply creates a readOnly object,
validated against all the rules and stores it as a readOnly object. No
reason you can't simply call the class again and create a separate
object. But this is where my 'model' of the world is an associative
array set of data handled by a separate set of code. If you need 100
read only dates for a calendar you only need one set of code to generate
them. The created objects would all be validated against the date rules
and then locked so you can't modify them.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk