@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | public static function checkDatas() |
| 64 | 64 | { |
| 65 | - self::existData(); |
|
| 65 | + self::existData(); |
|
| 66 | 66 | self::jsonData(); |
| 67 | 67 | self::hasProvider(); |
| 68 | 68 | self::hasRole(); |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | self::$model = self::getClass($model); |
| 80 | 80 | |
| 81 | - self::existRole(self::$model); |
|
| 81 | + self::existRole(self::$model); |
|
| 82 | 82 | |
| 83 | - foreach ( (self::$validators[self::$model]->getRules($datas['role'])) as $key => $value) { |
|
| 83 | + foreach ( (self::$validators[self::$model]->getRules($datas['role'])) as $key => $value) { |
|
| 84 | 84 | if(@$value['required'] === true){ |
| 85 | 85 | self::$required[$key] = $value; |
| 86 | 86 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | self::checkRequireds(); |
| 94 | 94 | |
| 95 | - return self::checkErrors(); |
|
| 95 | + return self::checkErrors(); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public static function checkErrors(): bool |
@@ -104,23 +104,23 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | foreach ( (self::$validators[self::$model]->getRules(self::$data['role'])) as $key => $value) { |
| 106 | 106 | |
| 107 | - foreach (json_decode(self::$data['data']) as $keyy => $valuee) { |
|
| 107 | + foreach (json_decode(self::$data['data']) as $keyy => $valuee) { |
|
| 108 | 108 | |
| 109 | - if(!array_key_exists($keyy, (self::$validators[self::$model]->getRules(self::$data['role'])) )){ |
|
| 109 | + if(!array_key_exists($keyy, (self::$validators[self::$model]->getRules(self::$data['role'])) )){ |
|
| 110 | 110 | throw new Exception("O campo '{$keyy}' não é esperado para está operação."); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if($keyy===$key){ |
|
| 113 | + if($keyy===$key){ |
|
| 114 | 114 | |
| 115 | 115 | unset(self::$required[$key]); |
| 116 | 116 | |
| 117 | - foreach ($value as $subkey => $subvalue) { |
|
| 117 | + foreach ($value as $subkey => $subvalue) { |
|
| 118 | 118 | $function = "check".ucfirst($subkey); |
| 119 | 119 | self::testMethod($function); |
| 120 | 120 | self::$function($keyy,$subvalue); |
| 121 | - } |
|
| 122 | - } |
|
| 123 | - } |
|
| 121 | + } |
|
| 122 | + } |
|
| 123 | + } |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | self::existRole(self::$model); |
| 151 | 151 | |
| 152 | - foreach ( self::$validators[self::$model]->getRules($request['role']) as $field => $r) { |
|
| 152 | + foreach ( self::$validators[self::$model]->getRules($request['role']) as $field => $r) { |
|
| 153 | 153 | $r = self::replaceRegex($r); |
| 154 | 154 | $response .= ("{$field}:".json_encode(array_reverse($r))).','; |
| 155 | 155 | } |