1 <?php
2
3 namespace Skimia\ApiFusion\Domain\Validation;
4
5
6 use Fadion\ValidatorAssistant\ValidatorAssistant;
7
8 class Validator extends ValidatorAssistant
9 {
10
11 12 13 14 15
16 public function bind()
17 {
18 if (func_num_args()) {
19 $bindings = new Bindings(func_get_args(), $this->rules);
20 $this->rules = $bindings->rules();
21 }
22
23 return $this;
24 }
25
26 27 28
29 public function __call($name, $args)
30 {
31 if (strpos($name, 'bind') !== false and count($args) == 1) {
32 $name = strtolower(substr($name, strlen('bind')));
33
34 $bindings = new Bindings(array(array($name => $args[0])), $this->rules);
35 $this->rules = $bindings->rules();
36
37 return $this;
38 }
39 }
40 }