Skip to content

Commit

Permalink
Chore: Rector Code Quality
Browse files Browse the repository at this point in the history
  • Loading branch information
ollyollyollyltd committed Feb 13, 2023
1 parent 4d09874 commit d4b880e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 0 additions & 3 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@

return function (RectorConfig $rectorConfig): void {
$rectorConfig->import(SetList::CODE_QUALITY);
$rectorConfig->import(SetList::PHP_80);
$rectorConfig->import(SetList::PHP_81);
$rectorConfig->import(SetList::PHP_82);
};
4 changes: 2 additions & 2 deletions src/apicore/structure/apicore.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function __call($name, $arguments)
$response = response::getInstance();
$response::verbUsed($this->httpMethod); //set the verb used for the request,
//do we have a logging class? If so, add data to it.
if (isset($this->logger)) {
if ($this->logger !== null) {
$this->logger->addMethod($this->httpMethod);
$this->logger->addRequestURL((string)$this->request);
$this->logger->addRequestArgs(json_encode($this->args));
Expand All @@ -224,7 +224,7 @@ public function __call($name, $arguments)
$response::addError($e->getCode(), $e->getMessage());
}

if (isset($this->logger)) {
if ($this->logger !== null) {
$this->logger->setResponseTime(time());
if (!empty($error = $response::getError())) {
$this->logger->addRawResponse($error['message']);
Expand Down
8 changes: 3 additions & 5 deletions src/apicore/structure/request.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ public function addPathElement($path, $reset = false)
}
if ($reset) {
$this->path = $elements;
} elseif (!empty($this->path)) {
$this->path = array_merge($this->path, $elements);
} else {
if (!empty($this->path)) {
$this->path = array_merge($this->path, $elements);
} else {
$this->path = $elements;
}
$this->path = $elements;
}
return $this;
}
Expand Down

0 comments on commit d4b880e

Please sign in to comment.