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)
3333
3434 public function __call ($ method , $ parameters )
3535 {
36- if (!method_exists ($ this , $ method )) {
36+ if (!method_exists ($ this , $ method )) {
3737 preg_match_all ('/((?:^|[A-Z])[a-z]+)/ ' , $ method , $ partials );
3838 $ 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 ' );
4141 }
4242 array_unshift ($ parameters , strtolower (implode ('_ ' , $ partials [0 ])));
4343 }
44+
4445 return $ this ->$ method (...$ parameters );
4546 }
4647
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ protected function get()
103103 {
104104 try {
105105 $ results = WooCommerce::all ($ this ->endpoint , $ this ->options );
106+
106107 return $ results ;
107108 } catch (\Exception $ ex ) {
108109 throw new \Exception ($ ex ->getMessage (), 1 );
@@ -153,7 +154,7 @@ protected function options($parameters)
153154 protected function where (...$ parameters )
154155 {
155156 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 ' );
157158 }
158159 $ field = $ parameters [0 ];
159160 $ value = count ($ parameters ) == 3 ? $ parameters [2 ] : $ parameters [1 ];
You can’t perform that action at this time.
0 commit comments