@@ -62,20 +62,68 @@ public function jsonSerialize() {
6262 return $ result ;
6363 }
6464
65- public static function match ($ name ,$ prompt =null ){
65+ public static function match ($ name ,$ prompt =NULL ){
6666 return new Rule ("match[ " .$ name ."] " ,$ prompt );
6767 }
6868
69- public static function integer ($ min =0 ,$ max =100 ,$ prompt =null ){
69+ public static function integer ($ min =0 ,$ max =100 ,$ prompt =NULL ){
7070 return new Rule ("integer[ {$ min }.. {$ max }] " ,$ prompt );
7171 }
7272
73- public static function decimal ($ prompt =null ){
74- return new Rule ("decimal] " ,$ prompt );
73+ public static function decimal ($ prompt =NULL ){
74+ return new Rule ("decimal " ,$ prompt );
7575 }
7676
77- public static function number ($ prompt =null ){
77+ public static function number ($ prompt =NULL ){
7878 return new Rule ("number " ,$ prompt );
7979 }
8080
81+ public static function is ($ value ,$ prompt =NULL ){
82+ return new Rule ("is[ " .$ value ."] " ,$ prompt );
83+ }
84+
85+ public static function isExactly ($ value ,$ prompt =NULL ){
86+ return new Rule ("isExactly[ " .$ value ."] " ,$ prompt );
87+ }
88+
89+ public static function not ($ value ,$ prompt =NULL ){
90+ return new Rule ("not[ " .$ value ."] " ,$ prompt );
91+ }
92+
93+ public static function notExactly ($ value ,$ prompt =NULL ){
94+ return new Rule ("notExactly[ " .$ value ."] " ,$ prompt );
95+ }
96+
97+ public static function contains ($ value ,$ prompt =NULL ){
98+ return new Rule ("contains[ " .$ value ."] " ,$ prompt );
99+ }
100+
101+ public static function containsExactly ($ value ,$ prompt =NULL ){
102+ return new Rule ("containsExactly[ " .$ value ."] " ,$ prompt );
103+ }
104+
105+ public static function doesntContain ($ value ,$ prompt =NULL ){
106+ return new Rule ("doesntContain[ " .$ value ."] " ,$ prompt );
107+ }
108+
109+ public static function doesntContainExactly ($ value ,$ prompt =NULL ){
110+ return new Rule ("doesntContainExactly[ " .$ value ."] " ,$ prompt );
111+ }
112+
113+ public static function minCount ($ value ,$ prompt =NULL ){
114+ return new Rule ("minCount[ " .$ value ."] " ,$ prompt );
115+ }
116+
117+ public static function maxCount ($ value ,$ prompt =NULL ){
118+ return new Rule ("maxCount[ " .$ value ."] " ,$ prompt );
119+ }
120+
121+ public static function exactCount ($ value ,$ prompt =NULL ){
122+ return new Rule ("exactCount[ " .$ value ."] " ,$ prompt );
123+ }
124+
125+ public static function email ($ prompt =NULL ){
126+ return new Rule ("email " ,$ prompt );
127+ }
128+
81129}
0 commit comments