Comments (7)
Implementation details (just for me to remember): The process of creating the exception on the AbstractRule will check if the user has setException
on that validator.
The ValidationException and it's children will have to deal with unknown exception classes on the chain possibly introduced by this technique. These custom exceptions will be the last leaf of the branches they are, since it's not possible to inspect them further.
The tell()
method is just a façade for building validators, exceptions and binding them in the two distinct decoupled hierarchies.
from validation.
Very nice!
π
from validation.
I was toying with interfaces and constants which we can extend and not have to duplicate the effort for similar messages. It does not support an array though but we can use the keys, as per the current implementation.
@algonet, your suggestion is for custom messages if I am right?
Something that really bugged me was the tokens being replaced via public properties on the rule class which seems very hackish. We could equally simple use a collection of tokens or abstracted to a token class with static token list and the replacement functionality included, allowing us to obfuscate the public properties instead.
This can then provide a list of replacement tokens which you can use in your custom messages too.
from validation.
that is working?
i am user develop branch, but doesn't work for me,
Which type of exeption should go in the catch() ?
from validation.
@xavadu this is a brainstorming ideas to implement still. Is there something you would like to add?
from validation.
Thanks @nickl- , i use it in an old project but was okay,
i remeber that this type of validation could be useful
from validation.
@xavadu glad you came right =)
from validation.
Related Issues (20)
- filterVal not correct working with FILTER_VALIDATE_INT HOT 1
- CountryCode validation for Montenegro HOT 2
- IntVal: ctype_digit gives a deprecated notice in PHP 8.1 HOT 3
- ctype_digit deprecation notice HOT 1
- Release 2.2.4 HOT 2
- Roadmap to 2.3 HOT 13
- Code coverage in local environment HOT 2
- [documentaiton] Validation for a full array of data HOT 3
- Formatter inconsequently stringifies values HOT 6
- IBAN Validation with non-breaking spaces HOT 1
- How do custom validation rules throw custom error messages? HOT 2
- How to compare two field HOT 1
- DateTime validation fails on valid ISO-8601 timestamp HOT 1
- phone() validation incorrectly invalidates valid UK phone numbers HOT 2
- phone() in 2.3 dont work correctly HOT 13
- RFC 3339 Z suffix no longer works with date-time validation in 2.3 HOT 16
- Date-related rules are not working today HOT 2
- Unexpected behavior with the country code rule in 2.3 HOT 4
- Roadmap to 3.0
- Increase code coverage HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validation.