Skip to content

Commit

Permalink
CS.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Dec 18, 2017
1 parent 442c982 commit af8d28b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/BasicService/Jssdk/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function getConfigArray(array $apis, bool $debug = false, bool $beta = fa
* @param bool $refresh
* @param string $type
*
* @return array
* @return array|null
*/
public function getTicket(bool $refresh = false, string $type = 'jsapi'): array
{
Expand Down Expand Up @@ -129,7 +129,7 @@ protected function configSignature(string $url = null, string $nonce = null, $ti
*/
public function getTicketSignature($ticket, $nonce, $timestamp, $url): string
{
return sha1("jsapi_ticket={$ticket}&noncestr={$nonce}&timestamp={$timestamp}&url={$url}");
return sha1(sprintf('jsapi_ticket=%s&noncestr=%s&timestamp=%s&url=%s', $ticket, $nonce, $timestamp, $url));
}

/**
Expand All @@ -141,7 +141,7 @@ public function dictionaryOrderSignature()

sort($params, SORT_STRING);

return sha1(implode($params));
return sha1(implode('', $params));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/BasicService/Jssdk/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function testDictionaryOrderSignature()

sort($params, SORT_STRING);

$this->assertSame(sha1(implode($params)), $client->dictionaryOrderSignature(...$unsorted));
$this->assertSame(sha1(implode('', $params)), $client->dictionaryOrderSignature(...$unsorted));
}

public function testUrlSetterAndGetter()
Expand Down

0 comments on commit af8d28b

Please sign in to comment.