@@ -86,7 +86,11 @@ public function greater_than_equal_to(?string $str, string $min): bool
8686 public function is_not_unique (?string $ str , string $ field , array $ data ): bool
8787 {
8888 // Grab any data for exclusion of a single row.
89- [$ field , $ whereField , $ whereValue ] = array_pad (explode (', ' , $ field ), 3 , null );
89+ [$ field , $ whereField , $ whereValue ] = array_pad (
90+ explode (', ' , $ field ),
91+ 3 ,
92+ null
93+ );
9094
9195 // Break the table and field apart
9296 sscanf ($ field , '%[^.].%[^.] ' , $ table , $ field );
@@ -97,7 +101,10 @@ public function is_not_unique(?string $str, string $field, array $data): bool
97101 ->where ($ field , $ str )
98102 ->limit (1 );
99103
100- if (! empty ($ whereField ) && ! empty ($ whereValue ) && ! preg_match ('/^\{(\w+)\}$/ ' , $ whereValue )) {
104+ if (
105+ ! empty ($ whereField ) && ! empty ($ whereValue )
106+ && ! preg_match ('/^\{(\w+)\}$/ ' , $ whereValue )
107+ ) {
101108 $ row = $ row ->where ($ whereField , $ whereValue );
102109 }
103110
@@ -125,7 +132,11 @@ public function in_list(?string $value, string $list): bool
125132 */
126133 public function is_unique (?string $ str , string $ field , array $ data ): bool
127134 {
128- [$ field , $ ignoreField , $ ignoreValue ] = array_pad (explode (', ' , $ field ), 3 , null );
135+ [$ field , $ ignoreField , $ ignoreValue ] = array_pad (
136+ explode (', ' , $ field ),
137+ 3 ,
138+ null
139+ );
129140
130141 sscanf ($ field , '%[^.].%[^.] ' , $ table , $ field );
131142
@@ -135,7 +146,10 @@ public function is_unique(?string $str, string $field, array $data): bool
135146 ->where ($ field , $ str )
136147 ->limit (1 );
137148
138- if (! empty ($ ignoreField ) && ! empty ($ ignoreValue ) && ! preg_match ('/^\{(\w+)\}$/ ' , $ ignoreValue )) {
149+ if (
150+ ! empty ($ ignoreField ) && ! empty ($ ignoreValue )
151+ && ! preg_match ('/^\{(\w+)\}$/ ' , $ ignoreValue )
152+ ) {
139153 $ row = $ row ->where ("{$ ignoreField } != " , $ ignoreValue );
140154 }
141155
0 commit comments