Skip to content

Commit

Permalink
Merge pull request #1150 from abraham/drop-php-7
Browse files Browse the repository at this point in the history
Drop php 7.4
  • Loading branch information
abraham committed Jan 17, 2023
2 parents 491d36c + 73d6287 commit e7f3e0f
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['8.0', '8.1']
name: PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"singleQuote": true,
"phpVersion": "7.4",
"phpVersion": "8.0",
"trailingCommaPHP": true,
"braceStyle": "psr-2"
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
],
"require": {
"php": "^7.4 || ^8.0 || ^8.1",
"php": "^8.0 || ^8.1",
"ext-curl": "*",
"composer/ca-bundle": "^1.2"
},
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Consumer
public function __construct(
?string $key,
?string $secret,
?string $callbackUrl = null
?string $callbackUrl = null,
) {
$this->key = $key;
$this->secret = $secret;
Expand Down
2 changes: 1 addition & 1 deletion src/HmacSha1.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getName()
public function buildSignature(
Request $request,
Consumer $consumer,
Token $token = null
Token $token = null,
): string {
$signatureBase = $request->getSignatureBaseString();

Expand Down
8 changes: 4 additions & 4 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Request
public function __construct(
string $httpMethod,
string $httpUrl,
?array $parameters = []
?array $parameters = [],
) {
$parameters = array_merge(
Util::parseParameters(parse_url($httpUrl, PHP_URL_QUERY)),
Expand Down Expand Up @@ -55,7 +55,7 @@ public static function fromConsumerAndToken(
string $httpMethod,
string $httpUrl,
array $parameters = [],
$json = false
$json = false,
) {
$defaults = [
'oauth_version' => Request::$version,
Expand Down Expand Up @@ -252,7 +252,7 @@ public function __toString(): string
public function signRequest(
SignatureMethod $signatureMethod,
Consumer $consumer,
Token $token = null
Token $token = null,
) {
$this->setParameter(
'oauth_signature_method',
Expand All @@ -272,7 +272,7 @@ public function signRequest(
public function buildSignature(
SignatureMethod $signatureMethod,
Consumer $consumer,
Token $token = null
Token $token = null,
): string {
return $signatureMethod->buildSignature($this, $consumer, $token);
}
Expand Down
4 changes: 2 additions & 2 deletions src/SignatureMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ abstract public function getName();
abstract public function buildSignature(
Request $request,
Consumer $consumer,
Token $token = null
Token $token = null,
);

/**
Expand All @@ -54,7 +54,7 @@ public function checkSignature(
Request $request,
Consumer $consumer,
Token $token,
string $signature
string $signature,
): bool {
$built = $this->buildSignature($request, $consumer, $token);

Expand Down
20 changes: 10 additions & 10 deletions src/TwitterOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(
string $consumerKey,
string $consumerSecret,
?string $oauthToken = null,
?string $oauthTokenSecret = null
?string $oauthTokenSecret = null,
) {
$this->resetLastResponse();
$this->signatureMethod = new HmacSha1();
Expand All @@ -73,7 +73,7 @@ public function __construct(
*/
public function setOauthToken(
string $oauthToken,
string $oauthTokenSecret
string $oauthTokenSecret,
): void {
$this->token = new Token($oauthToken, $oauthTokenSecret);
$this->bearer = null;
Expand Down Expand Up @@ -249,7 +249,7 @@ public function get(string $path, array $parameters = [])
public function post(
string $path,
array $parameters = [],
bool $json = false
bool $json = false,
) {
return $this->http('POST', self::API_HOST, $path, $parameters, $json);
}
Expand Down Expand Up @@ -279,7 +279,7 @@ public function delete(string $path, array $parameters = [])
public function put(
string $path,
array $parameters = [],
bool $json = false
bool $json = false,
) {
return $this->http('PUT', self::API_HOST, $path, $parameters, $json);
}
Expand All @@ -296,7 +296,7 @@ public function put(
public function upload(
string $path,
array $parameters = [],
bool $chunked = false
bool $chunked = false,
) {
if ($chunked) {
return $this->uploadMediaChunked($path, $parameters);
Expand Down Expand Up @@ -477,7 +477,7 @@ private function http(
string $host,
string $path,
array $parameters,
bool $json
bool $json,
) {
$this->resetLastResponse();
$this->resetAttemptsNumber();
Expand Down Expand Up @@ -530,7 +530,7 @@ private function makeRequests(
string $url,
string $method,
array $parameters,
bool $json
bool $json,
) {
do {
$this->sleepIfNeeded();
Expand Down Expand Up @@ -571,7 +571,7 @@ private function oAuthRequest(
string $url,
string $method,
array $parameters,
bool $json = false
bool $json = false,
) {
$request = Request::fromConsumerAndToken(
$this->consumer,
Expand Down Expand Up @@ -662,7 +662,7 @@ private function request(
string $method,
string $authorization,
array $postfields,
bool $json = false
bool $json = false,
): string {
$options = $this->curlOptions();
$options[CURLOPT_URL] = $url;
Expand Down Expand Up @@ -785,7 +785,7 @@ private function curlCaOpt(string $path): int
private function setPostfieldsOptions(
array $options,
array $postfields,
bool $json
bool $json,
): array {
if ($json) {
$options[CURLOPT_HTTPHEADER][] = 'Content-type: application/json';
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractSignatureMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function getRequest()
protected function getConsumer(
$key = null,
$secret = null,
$callbackUrl = null
$callbackUrl = null,
) {
return $this->getMockBuilder(\Abraham\TwitterOAuth\Consumer::class)
->setConstructorArgs([$key, $secret, $callbackUrl])
Expand Down

0 comments on commit e7f3e0f

Please sign in to comment.