Skip to content

Commit 9a58ca1

Browse files
committed
WS-3151: Code smells.
1 parent f32e7fd commit 9a58ca1

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

source/rosette/api/Api.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private function callEndpoint($parameters, $subUrl)
428428
// create multipart
429429
$clrf = "\r\n";
430430
$multi = '';
431-
$boundary = md5(time());
431+
$boundary = hash('sha256', (time()));
432432
$multi .= '--' . $boundary . $clrf;
433433
$multi .= 'Content-Type: application/json' . "\r\n";
434434
$multi .= 'Content-Disposition: mixed; name="request"' . "\r\n" . "\r\n";
@@ -496,9 +496,7 @@ private function makeRequest($url, $headers, $data, $method)
496496
private function getHttp($url, $headers)
497497
{
498498
$method = 'GET';
499-
$response = $this->makeRequest($url, $headers, null, $method);
500-
501-
return $response;
499+
return $this->makeRequest($url, $headers, null, $method);
502500
}
503501

504502
/**
@@ -520,9 +518,7 @@ private function getHttp($url, $headers)
520518
private function postHttp($url, $headers, $data)
521519
{
522520
$method = 'POST';
523-
$response = $this->makeRequest($url, $headers, $data, $method);
524-
525-
return $response;
521+
return $this->makeRequest($url, $headers, $data, $method);
526522
}
527523

528524
/**
@@ -535,9 +531,7 @@ private function postHttp($url, $headers, $data)
535531
public function ping()
536532
{
537533
$url = $this->service_url . 'ping';
538-
$resultObject = $this->getHttp($url, $this->headers);
539-
540-
return $resultObject;
534+
return $resultObject = $this->getHttp($url, $this->headers);
541535
}
542536

543537
/**

0 commit comments

Comments
 (0)