@@ 130-139 (lines=10) @@ | ||
127 | } |
|
128 | } |
|
129 | ||
130 | if (! function_exists('length')) { |
|
131 | function length($value, array $args) |
|
132 | { |
|
133 | if (!is_valid_type_for_length($value)) { |
|
134 | throw new InvalidTypeParameter('Invalid parameter type'); |
|
135 | } |
|
136 | ||
137 | return get_length($value) === $args[Field::VAR_LIMIT]; |
|
138 | } |
|
139 | } |
|
140 | ||
141 | if (! function_exists('length_less_than')) { |
|
142 | function length_less_than($value, array $args) |
|
@@ 141-150 (lines=10) @@ | ||
138 | } |
|
139 | } |
|
140 | ||
141 | if (! function_exists('length_less_than')) { |
|
142 | function length_less_than($value, array $args) |
|
143 | { |
|
144 | if (!is_valid_type_for_length($value)) { |
|
145 | throw new InvalidTypeParameter('Invalid parameter type'); |
|
146 | } |
|
147 | ||
148 | return get_length($value) < $args[Field::VAR_LIMIT]; |
|
149 | } |
|
150 | } |
|
151 | ||
152 | if (! function_exists('length_greater_than')) { |
|
153 | function length_greater_than($value, array $args) |
|
@@ 152-161 (lines=10) @@ | ||
149 | } |
|
150 | } |
|
151 | ||
152 | if (! function_exists('length_greater_than')) { |
|
153 | function length_greater_than($value, array $args) |
|
154 | { |
|
155 | if (!is_valid_type_for_length($value)) { |
|
156 | throw new InvalidTypeParameter('Invalid parameter type'); |
|
157 | } |
|
158 | ||
159 | return get_length($value) > $args[Field::VAR_LIMIT]; |
|
160 | } |
|
161 | } |
|
162 | ||
163 | if (! function_exists('length_less_or_equal_than')) { |
|
164 | function length_less_or_equal_than($value, array $args) |
|
@@ 163-172 (lines=10) @@ | ||
160 | } |
|
161 | } |
|
162 | ||
163 | if (! function_exists('length_less_or_equal_than')) { |
|
164 | function length_less_or_equal_than($value, array $args) |
|
165 | { |
|
166 | if (!is_valid_type_for_length($value)) { |
|
167 | throw new InvalidTypeParameter('Invalid parameter type'); |
|
168 | } |
|
169 | ||
170 | return get_length($value) <= $args[Field::VAR_LIMIT]; |
|
171 | } |
|
172 | } |
|
173 | ||
174 | if (! function_exists('length_greater_or_equal_than')) { |
|
175 | function length_greater_or_equal_than($value, array $args) |
|
@@ 174-183 (lines=10) @@ | ||
171 | } |
|
172 | } |
|
173 | ||
174 | if (! function_exists('length_greater_or_equal_than')) { |
|
175 | function length_greater_or_equal_than($value, array $args) |
|
176 | { |
|
177 | if (!is_valid_type_for_length($value)) { |
|
178 | throw new InvalidTypeParameter('Invalid parameter type'); |
|
179 | } |
|
180 | ||
181 | return get_length($value) >= $args[Field::VAR_LIMIT]; |
|
182 | } |
|
183 | } |
|
184 | ||
185 | if (! function_exists('length_between')) { |
|
186 | function length_between($value, array $args) |