Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

PHP 8.4 support added #23

Merged
merged 23 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a815421
PHP 8.4 support added
manishranjan-adobe Oct 18, 2024
82d6eac
MD file linting issue fix
manishranjan-adobe Oct 18, 2024
b5750c1
composer.lock PHP_Codesniffer fix
manishranjan-adobe Oct 18, 2024
7938522
Ignore pathform dependency
manishranjan-adobe Oct 18, 2024
7a1039b
Fix PHP 8.4 deprecation: Implicitly marking parameter as nullable is …
manishranjan-adobe Oct 21, 2024
7a8df59
Backward compatibility fix
manishranjan-adobe Oct 21, 2024
8f887b3
Updated outdated laminas/laminas-coding-standard and squizlabs/php_co…
manishranjan-adobe Oct 22, 2024
34c4a12
Upgraded phpunit version slightly to support PHP8.4
manishranjan-adobe Oct 22, 2024
09281fb
Fix PHP 8.4 deprecation: Implicitly marking parameter as nullable is …
manishranjan-adobe Oct 22, 2024
79b87c3
Fixed PHPCS issues
manishranjan-adobe Oct 22, 2024
3a961c0
Fixed PHPCS issues
manishranjan-adobe Oct 22, 2024
c95ea46
Fixed tests folder PHPCS issues
manishranjan-adobe Oct 22, 2024
19426e1
Fixed BC issues fix
manishranjan-adobe Oct 22, 2024
66b91f2
PHPCS configuration changes
manishranjan-adobe Oct 22, 2024
c8fe9cf
PHPCS issues fix
manishranjan-adobe Oct 22, 2024
9c09134
removed 8.2 platform dependency
manishranjan-adobe Oct 22, 2024
c6e446d
Fix phpunit config and improve code optimization
manishranjan-adobe Oct 22, 2024
f45e41c
PR suggested changes
manishranjan-adobe Oct 22, 2024
5472882
Reverted original code with additional check
manishranjan-adobe Oct 22, 2024
2aa1da4
PHPCS Fix
manishranjan-adobe Oct 22, 2024
8c0ff7f
Reveresed original code
manishranjan-adobe Oct 22, 2024
24fab99
PR suggested changes
manishranjan-adobe Oct 23, 2024
79e7aee
Modified type casting to ensure consistency across lib
manishranjan-adobe Oct 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions phpcs.xml

This file was deleted.

25 changes: 0 additions & 25 deletions phpunit.xml

This file was deleted.

13 changes: 6 additions & 7 deletions src/Client.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth;

use Laminas\Http\Client as HttpClient;
Expand All @@ -14,6 +12,7 @@
use function array_merge;
use function call_user_func_array;
use function method_exists;
use function strtolower;

class Client extends HttpClient
{
Expand Down Expand Up @@ -148,15 +147,15 @@ public function setRawDataStream($data, $enctype = null)
*/
public function setMethod($method = HttpRequest::METHOD_GET)
{
if ($method === HttpRequest::METHOD_GET) {
if (strtolower($method) === strtolower(HttpRequest::METHOD_GET)) {
$this->setRequestMethod(HttpRequest::METHOD_GET);
} elseif ($method === HttpRequest::METHOD_POST) {
} elseif (strtolower($method) === strtolower(HttpRequest::METHOD_POST)) {
$this->setRequestMethod(HttpRequest::METHOD_POST);
} elseif ($method === HttpRequest::METHOD_PUT) {
} elseif (strtolower($method) === strtolower(HttpRequest::METHOD_PUT)) {
$this->setRequestMethod(HttpRequest::METHOD_PUT);
} elseif ($method === HttpRequest::METHOD_DELETE) {
} elseif (strtolower($method) === strtolower(HttpRequest::METHOD_DELETE)) {
$this->setRequestMethod(HttpRequest::METHOD_DELETE);
} elseif ($method === HttpRequest::METHOD_HEAD) {
} elseif (strtolower($method) === strtolower(HttpRequest::METHOD_HEAD)) {
$this->setRequestMethod(HttpRequest::METHOD_HEAD);
}
return parent::setMethod($method);
Expand Down
52 changes: 40 additions & 12 deletions src/Config/ConfigInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Config;

use Laminas\OAuth\Token\TokenInterface;
Expand All @@ -10,43 +8,73 @@ interface ConfigInterface
{
public function setOptions(array $options);

public function setConsumerKey(string $key);
/**
* @param string $key
*/
public function setConsumerKey($key);

public function getConsumerKey();

public function setConsumerSecret(string $secret);
/**
* @param string $secret
*/
public function setConsumerSecret($secret);

public function getConsumerSecret();

public function setSignatureMethod(string $method);
/**
* @param string $method
*/
public function setSignatureMethod($method);

public function getSignatureMethod();

public function setRequestScheme(string $scheme);
/**
* @param string $scheme
*/
public function setRequestScheme($scheme);

public function getRequestScheme();

public function setVersion(string $version);
/**
* @param string $version
*/
public function setVersion($version);

public function getVersion();

public function setCallbackUrl(string $url);
/**
* @param string $url
*/
public function setCallbackUrl($url);

public function getCallbackUrl();

public function setRequestTokenUrl(string $url);
/**
* @param string $url
*/
public function setRequestTokenUrl($url);

public function getRequestTokenUrl();

public function setRequestMethod(string $method);
/**
* @param string $method
*/
public function setRequestMethod($method);

public function getRequestMethod();

public function setAccessTokenUrl(string $url);
/**
* @param string $url
*/
public function setAccessTokenUrl($url);

public function getAccessTokenUrl();

public function setUserAuthorizationUrl(string $url);
/**
* @param string $url
*/
public function setUserAuthorizationUrl($url);

public function getUserAuthorizationUrl();

Expand Down
2 changes: 0 additions & 2 deletions src/Config/StandardConfig.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Config;

use Laminas\Crypt\PublicKey\Rsa\PrivateKey;
Expand Down
2 changes: 0 additions & 2 deletions src/Consumer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth;

use Laminas\OAuth\Config;
Expand Down
2 changes: 0 additions & 2 deletions src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Exception;

class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface
Expand Down
2 changes: 0 additions & 2 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Exception;

interface ExceptionInterface
Expand Down
2 changes: 0 additions & 2 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Exception;

class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
Expand Down
2 changes: 0 additions & 2 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Exception;

class RuntimeException extends \RuntimeException implements ExceptionInterface
Expand Down
2 changes: 0 additions & 2 deletions src/Http.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth;

use Laminas\Http\Client;
Expand Down
2 changes: 0 additions & 2 deletions src/Http/AccessToken.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Http;

use Laminas\Http;
Expand Down
2 changes: 0 additions & 2 deletions src/Http/RequestToken.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Http;

use Laminas\Http;
Expand Down
2 changes: 0 additions & 2 deletions src/Http/UserAuthorization.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Http;

use Laminas\OAuth\Client;
Expand Down
2 changes: 0 additions & 2 deletions src/Http/Utility.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Http;

use Laminas\OAuth\Config\ConfigInterface;
Expand Down
2 changes: 0 additions & 2 deletions src/OAuth.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth;

use Laminas\Http\Client as HTTPClient;
Expand Down
2 changes: 0 additions & 2 deletions src/Signature/AbstractSignature.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Signature;

use Laminas\OAuth\Exception;
Expand Down
2 changes: 0 additions & 2 deletions src/Signature/Hmac.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Signature;

use Laminas\Crypt\Hmac as HMACEncryption;
Expand Down
2 changes: 0 additions & 2 deletions src/Signature/Plaintext.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Signature;

use function implode;
Expand Down
2 changes: 0 additions & 2 deletions src/Signature/Rsa.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Signature;

use Laminas\Crypt\PublicKey\Rsa as RsaEnc;
Expand Down
2 changes: 0 additions & 2 deletions src/Signature/SignatureInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Signature;

interface SignatureInterface
Expand Down
9 changes: 5 additions & 4 deletions src/Token/AbstractToken.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Token;

use Laminas\Http\Response as HTTPResponse;
Expand Down Expand Up @@ -181,8 +179,11 @@ public function getToken()

/**
* Generic accessor to enable access as public properties.
*
* @param string $key
* @return mixed|null
*/
public function __get(string $key): mixed
public function __get($key)
{
return $this->getParam($key);
}
Expand Down Expand Up @@ -248,7 +249,7 @@ protected function parseParameters(HTTPResponse $response)
*
* @return array
*/
public function __sleep(): array
public function __sleep()
{
return ['_params'];
}
Expand Down
2 changes: 0 additions & 2 deletions src/Token/Access.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Token;

use Laminas\OAuth\Client;
Expand Down
2 changes: 0 additions & 2 deletions src/Token/AuthorizedRequest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Token;

use Laminas\OAuth\Http;
Expand Down
2 changes: 0 additions & 2 deletions src/Token/Request.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Token;

use Laminas\Http\Response as HTTPResponse;
Expand Down
2 changes: 0 additions & 2 deletions src/Token/TokenInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace Laminas\OAuth\Token;

use Laminas\Http\Response as HTTPResponse;
Expand Down
3 changes: 0 additions & 3 deletions test/Config/StandardConfigurationTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php

declare(strict_types=1);

namespace LaminasTest\OAuth\Config;

use Laminas\OAuth\Config\StandardConfig;
Expand Down
2 changes: 0 additions & 2 deletions test/ConsumerTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace LaminasTest\OAuth;

use Laminas\OAuth\Consumer;
Expand Down
2 changes: 0 additions & 2 deletions test/Http/AccessTokenTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

namespace LaminasTest\OAuth\Http;

use Laminas\OAuth\Http;
Expand Down
Loading
Loading