Comments (4)
- As an author of the custom rule, what would be different for me to implement / use the rule?
- What if I want to ship it in a Composer package?
- As a rule user, what would be different for me?
from validator.
- As an author of the custom rule, what would be different for me to implement / use the rule?
Implementation:
- method
RuleInterface::getName()
need to implement only when user used convertation rules to array - if options needed, then yet another class for convert rule to array will be required (also user can implement new interface in rule).
Usage:
- add ability to change converatation to array for any rule.
- What if I want to ship it in a Composer package?
It can be configured via Yii Config or manually.
- As a rule user, what would be different for me?
See 1.
from validator.
I like the ability to configure it, but I don't think we need to separate this information, since it logically belongs to rule itself.
from validator.
In some cases need ability to configure converter rule to array. For example date format in date rule. In this case need to use separate converter.
from validator.
Related Issues (20)
- Remove or improve `RulesDumper` HOT 5
- Increase MSI to 100%
- Add support non-public properties for dot notation in `Nested` rule
- Add methods `getFirstErrorMessagesIndexedByAttribute()` and `getFirstErrorMessagesIndexedByPath()` to `Result` class HOT 2
- Way to add error with custom value path HOT 2
- Return error code for API application HOT 6
- Can rule Integer allow only 'int'? HOT 1
- Add method to merge several validation results to one HOT 3
- Replace `mixed $skipOnEmpty` in rules constructors to `bool|callable|null $skipOnEmpty` HOT 3
- update irc link
- update docs folder link
- Allow to validate aspect ratio in `Image` rule
- Replace type rule in `RuleHandlerInterface::validate()` from `object` to `RuleInterface`
- Extract rule name and options to separate collector HOT 1
- Add `Unique` rule for validating `iterable` HOT 1
- Add `Any` rule
- `AtLeast`, `OneOf` naming - not clear that they are applied to attributes, not other rules HOT 2
- `AnyRule` - make the error message more detailed HOT 1
- `UniqueIterable` rule - add non-strict mode to support values of different types HOT 1
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 validator.