@@ -10,8 +10,7 @@ discard block |
||
10 | 10 | public function __construct($translator, $data, $rules, $messages, array $customAttributes = array()) |
11 | 11 | { |
12 | 12 | // Set custom validation error messages |
13 | - if(!isset($messages['unique_with'])) |
|
14 | - { |
|
13 | + if(!isset($messages['unique_with'])) { |
|
15 | 14 | $messages['unique_with'] = $translator->get( |
16 | 15 | 'uniquewith-validator::validation.unique_with' |
17 | 16 | ); |
@@ -59,28 +58,23 @@ discard block |
||
59 | 58 | // case 2: |
60 | 59 | // $parameter = 'last_name=sur_name' |
61 | 60 | // => field_name = 'last_name', column_name = 'sur_name' |
62 | - foreach ($parameters as $parameter) |
|
63 | - { |
|
61 | + foreach ($parameters as $parameter) { |
|
64 | 62 | $parameter = array_map('trim', explode('=', $parameter, 2)); |
65 | 63 | $field_name = $parameter[0]; |
66 | 64 | |
67 | - if (count($parameter) > 1) |
|
68 | - { |
|
65 | + if (count($parameter) > 1) { |
|
69 | 66 | $column_name = $parameter[1]; |
70 | 67 | } |
71 | - else |
|
72 | - { |
|
68 | + else { |
|
73 | 69 | $column_name = $field_name; |
74 | 70 | } |
75 | 71 | |
76 | 72 | // Figure out whether main field_name has an explicitly specified |
77 | 73 | // column_name |
78 | - if ($field_name == $column) |
|
79 | - { |
|
74 | + if ($field_name == $column) { |
|
80 | 75 | $column = $column_name; |
81 | 76 | } |
82 | - else |
|
83 | - { |
|
77 | + else { |
|
84 | 78 | $extra[$column_name] = array_get($this->data, $field_name); |
85 | 79 | } |
86 | 80 | } |
@@ -134,8 +128,7 @@ discard block |
||
134 | 128 | |
135 | 129 | // An ignore_id is only specified if the last param starts with a |
136 | 130 | // number greater than 1 (a valid id in the database) |
137 | - if (!preg_match('/^[1-9][0-9]*$/', $lastParam[0])) |
|
138 | - { |
|
131 | + if (!preg_match('/^[1-9][0-9]*$/', $lastParam[0])) { |
|
139 | 132 | return array(null, null); |
140 | 133 | } |
141 | 134 |