Skip to content

Commit da62e30

Browse files
authored
Merge pull request #30 from Codexshaper/analysis-642lKM
Apply fixes from StyleCI
2 parents a63d8f1 + 2374427 commit da62e30

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Models/BaseModel.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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

src/Traits/QueryBuilderTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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];

0 commit comments

Comments
 (0)