File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,15 @@ public function __set($name, $value)
33
33
34
34
public function __call ($ method , $ parameters )
35
35
{
36
- if (!method_exists ($ this , $ method )) {
36
+ if (!method_exists ($ this , $ method )) {
37
37
preg_match_all ('/((?:^|[A-Z])[a-z]+)/ ' , $ method , $ partials );
38
38
$ method = array_shift ($ partials [0 ]);
39
- if (!method_exists ($ this , $ method )) {
40
- throw new \Exception (" Sorry! you are calling wrong method " );
39
+ if (!method_exists ($ this , $ method )) {
40
+ throw new \Exception (' Sorry! you are calling wrong method ' );
41
41
}
42
42
array_unshift ($ parameters , strtolower (implode ('_ ' , $ partials [0 ])));
43
43
}
44
+
44
45
return $ this ->$ method (...$ parameters );
45
46
}
46
47
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ protected function get()
103
103
{
104
104
try {
105
105
$ results = WooCommerce::all ($ this ->endpoint , $ this ->options );
106
+
106
107
return $ results ;
107
108
} catch (\Exception $ ex ) {
108
109
throw new \Exception ($ ex ->getMessage (), 1 );
@@ -153,7 +154,7 @@ protected function options($parameters)
153
154
protected function where (...$ parameters )
154
155
{
155
156
if (count ($ parameters ) < 2 || count ($ parameters ) > 3 ) {
156
- throw new \Exception (" Too many arguments. You can pass minimum 2 and maximum 3 paramneters " );
157
+ throw new \Exception (' Too many arguments. You can pass minimum 2 and maximum 3 paramneters ' );
157
158
}
158
159
$ field = $ parameters [0 ];
159
160
$ value = count ($ parameters ) == 3 ? $ parameters [2 ] : $ parameters [1 ];
You can’t perform that action at this time.
0 commit comments