Skip to content

Commit

Permalink
Fix Psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Narek13 committed Nov 6, 2023
1 parent 27ec58c commit 763fff5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private function request($method, $path, $data = [], $headers = [])
);

if (is_wp_error($response)) {
throw new ApiException($response->get_error_message(), $response->get_error_code());
throw new ApiException($response->get_error_message(), (int)$response->get_error_code());
}

$response_code = wp_remote_retrieve_response_code($response);
Expand Down
2 changes: 1 addition & 1 deletion src/Xliff/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ protected function importPost(
$postData = array_merge((array)$targetPost, $postData);
}
$targetPostId = wp_insert_post($postData, true);
$targetPost = $targetPostId ? get_post($targetPostId) : null;
$targetPost = !is_wp_error($targetPostId) ? get_post($targetPostId) : null;

if (!$targetPost) {
return false;
Expand Down

0 comments on commit 763fff5

Please sign in to comment.