swoft-cloud / swoft-component

📦 This is a repository of centralized management of all swoft core components
https://www.swoft.org
Apache License 2.0
97 stars 107 forks source link

Add attribute `format` for Date Annotation Validator #551

Closed jay-youngn closed 4 years ago

jay-youngn commented 4 years ago

What does this PR do?

Add attribute format for Date Annotation Validator If write annotation:

/**
 * @Date(format="YmdHi")
 */

Will only passes value like 202001020039

Motivation

We have a payment center will building by Swoft. And now this validator methods are relatively lax. I needs to check the parameters strictly.

More

Additional Notes

Nothing

jay-youngn commented 4 years ago

Commited to private repository

jay-youngn commented 4 years ago

Compare: https://github.com/swoft-cloud/swoft-validator/compare/master...ginnerpeace:master