Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Jan 6, 2025
1 parent b8d4cee commit 16f1672
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
run: composer update --no-interaction --prefer-stable --prefer-lowest --no-progress

- name: Run tests
run: make test
run: vendor/bin/phpunit

build:
name: Build
runs-on: ubuntu-22.04
strategy:
max-parallel: 10
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

steps:
- name: Set up PHP
Expand All @@ -52,4 +52,4 @@ jobs:
run: composer update --no-interaction --no-progress

- name: Run tests
run: make test
run: vendor/bin/phpunit
19 changes: 7 additions & 12 deletions src/Oauth1.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Oauth1
*
* @param array $config Configuration array.
*/
public function __construct($config)
public function __construct(array $config)
{
$this->config = [
'version' => '1.0',
Expand Down Expand Up @@ -219,7 +219,7 @@ protected function createBaseString(RequestInterface $request, array $params)
*
* @return array
*/
private function prepareParameters($data)
private function prepareParameters(array $data)
{
// Parameters are sorted by name, using lexicographical byte value
// ordering. Ref: Spec: 9.1.1 (1).
Expand All @@ -235,12 +235,11 @@ private function prepareParameters($data)
}

/**
* @param string $algo Name of selected hashing algorithm (i.e. "md5", "sha256", "haval160,4", etc..)
* @param string $baseString
* @param string $algo Name of selected hashing algorithm (i.e. "md5", "sha256", "haval160,4", etc..)
*
* @return string
*/
private function signUsingHmac($algo, $baseString)
private function signUsingHmac(string $algo, string $baseString)
{
$key = rawurlencode($this->config['consumer_secret']).'&';
if (isset($this->config['token_secret'])) {
Expand All @@ -251,11 +250,9 @@ private function signUsingHmac($algo, $baseString)
}

/**
* @param string $baseString
*
* @return string
*/
private function signUsingRsaSha1($baseString)
private function signUsingRsaSha1(string $baseString)
{
if (!function_exists('openssl_pkey_get_private')) {
throw new \RuntimeException('RSA-SHA1 signature method '
Expand All @@ -275,11 +272,9 @@ private function signUsingRsaSha1($baseString)
}

/**
* @param string $baseString
*
* @return string
*/
private function signUsingPlaintext($baseString)
private function signUsingPlaintext(string $baseString)
{
return $baseString;
}
Expand Down Expand Up @@ -315,7 +310,7 @@ private function buildAuthorizationHeader(array $params)
*
* @return array
*/
private function getOauthParams($nonce, array $config)
private function getOauthParams(string $nonce, array $config)
{
$params = [
'oauth_consumer_key' => $config['consumer_key'],
Expand Down

0 comments on commit 16f1672

Please sign in to comment.