update lock clucknut
All checks were successful
All checks were successful
This commit is contained in:
@@ -4,7 +4,7 @@ on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "master"
|
||||
|
||||
jobs:
|
||||
phpunit:
|
||||
@@ -17,17 +17,15 @@ jobs:
|
||||
dependencies:
|
||||
- "highest"
|
||||
php-version:
|
||||
- "7.2"
|
||||
- "7.3"
|
||||
- "7.4"
|
||||
- "8.0"
|
||||
- "8.1"
|
||||
- "8.2"
|
||||
- "8.3"
|
||||
- "8.4"
|
||||
- "8.5"
|
||||
|
||||
include:
|
||||
- php-version: '7.2'
|
||||
- php-version: '8.0'
|
||||
dependencies: "lowest"
|
||||
|
||||
steps:
|
||||
@@ -50,5 +48,10 @@ jobs:
|
||||
if: ${{ matrix.dependencies == 'highest' }}
|
||||
run: "composer update --no-interaction --no-progress"
|
||||
|
||||
- name: "Tests"
|
||||
run: "vendor/bin/phpunit"
|
||||
- name: "Tests (PHPUnit 9)"
|
||||
if: ${{ matrix.php-version <= '8.0' }}
|
||||
run: "vendor/bin/phpunit --configuration phpunit9.xml.dist"
|
||||
|
||||
- name: "Tests (PHPUnit 10+)"
|
||||
if: ${{ matrix.php-version >= '8.1' }}
|
||||
run: "vendor/bin/phpunit"
|
||||
13
vendor/omnipay/common/composer.json
vendored
13
vendor/omnipay/common/composer.json
vendored
@@ -42,24 +42,25 @@
|
||||
"classmap": ["tests/OmnipayTest.php"]
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2|^8",
|
||||
"php": "^8",
|
||||
"php-http/client-implementation": "^1",
|
||||
"php-http/message": "^1.5",
|
||||
"php-http/message-factory": "^1.1",
|
||||
"php-http/discovery": "^1.14",
|
||||
"symfony/http-foundation": "^2.1|^3|^4|^5|^6|^7",
|
||||
"moneyphp/money": "^3.1|^4.0.3"
|
||||
"symfony/http-foundation": "^2.1|^3|^4|^5|^6|^7|^8",
|
||||
"moneyphp/money": "^3.1|^4.0.3",
|
||||
"psr/http-factory": "^1"
|
||||
},
|
||||
"require-dev": {
|
||||
"omnipay/tests": "^4.1",
|
||||
"php-http/mock-client": "^1.6",
|
||||
"php-http/guzzle7-adapter": "^1",
|
||||
"squizlabs/php_codesniffer": "^3.8.1",
|
||||
"http-interop/http-factory-guzzle": "^1.1"
|
||||
"http-interop/http-factory-guzzle": "^1.1",
|
||||
"php-http/message-factory": "^1.1"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.1.x-dev"
|
||||
"dev-master": "3.5.x-dev"
|
||||
}
|
||||
},
|
||||
"suggest": {
|
||||
|
||||
32
vendor/omnipay/common/phpunit9.xml.dist
vendored
Normal file
32
vendor/omnipay/common/phpunit9.xml.dist
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
verbose="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
||||
<coverage>
|
||||
<include>
|
||||
<directory suffix=".php">src/</directory>
|
||||
</include>
|
||||
<report>
|
||||
<clover outputFile="build/logs/clover.xml"/>
|
||||
<html outputDirectory="build/coverage"/>
|
||||
<text outputFile="build/coverage.txt"/>
|
||||
</report>
|
||||
</coverage>
|
||||
<testsuites>
|
||||
<testsuite name="Omnipay Test Suite">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<logging>
|
||||
<junit outputFile="build/report.junit.xml"/>
|
||||
</logging>
|
||||
</phpunit>
|
||||
4
vendor/omnipay/common/src/Common/AbstractGateway.php
vendored
Normal file → Executable file
4
vendor/omnipay/common/src/Common/AbstractGateway.php
vendored
Normal file → Executable file
@@ -5,8 +5,8 @@
|
||||
|
||||
namespace Omnipay\Common;
|
||||
|
||||
use Omnipay\Common\Http\Client;
|
||||
use Omnipay\Common\Http\ClientInterface;
|
||||
use Omnipay\Common\Http\PsrClient;
|
||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
use Symfony\Component\HttpFoundation\Request as HttpRequest;
|
||||
|
||||
@@ -329,7 +329,7 @@ protected function createRequest($class, array $parameters)
|
||||
*/
|
||||
protected function getDefaultHttpClient()
|
||||
{
|
||||
return new Client();
|
||||
return new PsrClient();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
109
vendor/omnipay/common/src/Common/Http/AbstractClient.php
vendored
Normal file
109
vendor/omnipay/common/src/Common/Http/AbstractClient.php
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Common\Http;
|
||||
|
||||
use Http\Discovery\Psr17FactoryDiscovery;
|
||||
use Http\Discovery\Psr18ClientDiscovery;
|
||||
use Http\Message\RequestFactory;
|
||||
use Omnipay\Common\Http\Exception\NetworkException;
|
||||
use Omnipay\Common\Http\Exception\RequestException;
|
||||
use Psr\Http\Client\ClientInterface as HttpClientInterface;
|
||||
use Psr\Http\Client\NetworkExceptionInterface;
|
||||
use Psr\Http\Message\RequestFactoryInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamFactoryInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
abstract class AbstractClient implements ClientInterface
|
||||
{
|
||||
/** @var HttpClientInterface */
|
||||
private $httpClient;
|
||||
|
||||
/** @var RequestFactoryInterface|RequestFactory */
|
||||
private $requestFactory;
|
||||
|
||||
/** @var StreamFactoryInterface|null */
|
||||
private $streamFactory;
|
||||
|
||||
public function __construct(
|
||||
$httpClient = null,
|
||||
null|RequestFactoryInterface|RequestFactory $requestFactory = null,
|
||||
?StreamFactoryInterface $streamFactory = null
|
||||
) {
|
||||
$this->httpClient = $httpClient ?: Psr18ClientDiscovery::find();
|
||||
$this->requestFactory = $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory();
|
||||
$this->streamFactory = $streamFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function request(
|
||||
$method,
|
||||
$uri,
|
||||
array $headers = [],
|
||||
$body = null,
|
||||
$protocolVersion = '1.1'
|
||||
) {
|
||||
$request = $this->createRequest($method, $uri, $headers, $body, $protocolVersion);
|
||||
|
||||
return $this->sendRequest($request);
|
||||
}
|
||||
|
||||
protected function createRequest(
|
||||
$method,
|
||||
$uri,
|
||||
array $headers = [],
|
||||
$body = null,
|
||||
$protocolVersion = '1.1'
|
||||
): RequestInterface {
|
||||
if ($this->requestFactory instanceof RequestFactory) {
|
||||
return $this->requestFactory->createRequest($method, $uri, $headers, $body, $protocolVersion);
|
||||
}
|
||||
|
||||
$request = $this->requestFactory->createRequest($method, $uri)->withProtocolVersion($protocolVersion);
|
||||
|
||||
foreach ($headers as $name => $value) {
|
||||
$request = $request->withHeader($name, $value);
|
||||
}
|
||||
|
||||
if ($body !== '' && $body !== null) {
|
||||
if (is_resource($body)) {
|
||||
$stream = $this->getStreamFactory()->createStreamFromResource($body);
|
||||
} elseif ($body instanceof StreamInterface) {
|
||||
$stream = $body;
|
||||
} elseif (is_scalar($body) || (is_object($body) && method_exists($body, '__toString'))) {
|
||||
$stream = $this->getStreamFactory()->createStream((string)$body);
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Invalid body type: ' . gettype($body));
|
||||
}
|
||||
$request = $request->withBody($stream);
|
||||
}
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestInterface $request
|
||||
* @return ResponseInterface
|
||||
* @throws NetworkException|RequestException
|
||||
*/
|
||||
private function sendRequest(RequestInterface $request)
|
||||
{
|
||||
try {
|
||||
return $this->httpClient->sendRequest($request);
|
||||
} catch (NetworkExceptionInterface $networkException) {
|
||||
throw new NetworkException($networkException->getMessage(), $request, $networkException);
|
||||
} catch (\Throwable $exception) {
|
||||
throw new RequestException($exception->getMessage(), $request, $exception);
|
||||
}
|
||||
}
|
||||
|
||||
private function getStreamFactory(): StreamFactoryInterface
|
||||
{
|
||||
$this->streamFactory = $this->streamFactory ?: Psr17FactoryDiscovery::findStreamFactory();
|
||||
|
||||
return $this->streamFactory;
|
||||
}
|
||||
}
|
||||
66
vendor/omnipay/common/src/Common/Http/Client.php
vendored
66
vendor/omnipay/common/src/Common/Http/Client.php
vendored
@@ -2,71 +2,15 @@
|
||||
|
||||
namespace Omnipay\Common\Http;
|
||||
|
||||
use Http\Client\HttpClient;
|
||||
use Http\Discovery\HttpClientDiscovery;
|
||||
use Http\Discovery\MessageFactoryDiscovery;
|
||||
use Http\Message\RequestFactory;
|
||||
use Omnipay\Common\Http\Exception\NetworkException;
|
||||
use Omnipay\Common\Http\Exception\RequestException;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
class Client implements ClientInterface
|
||||
/**
|
||||
* @deprecated use Psr18Client instead
|
||||
*/
|
||||
class Client extends AbstractClient
|
||||
{
|
||||
/**
|
||||
* The Http Client which implements `public function sendRequest(RequestInterface $request)`
|
||||
* Note: Will be changed to PSR-18 when released
|
||||
*
|
||||
* @var HttpClient
|
||||
*/
|
||||
private $httpClient;
|
||||
|
||||
/**
|
||||
* @var RequestFactory
|
||||
*/
|
||||
private $requestFactory;
|
||||
|
||||
public function __construct($httpClient = null, ?RequestFactory $requestFactory = null)
|
||||
{
|
||||
$this->httpClient = $httpClient ?: HttpClientDiscovery::find();
|
||||
$this->requestFactory = $requestFactory ?: MessageFactoryDiscovery::find();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $method
|
||||
* @param $uri
|
||||
* @param array $headers
|
||||
* @param string|array|resource|StreamInterface|null $body
|
||||
* @param string $protocolVersion
|
||||
* @return ResponseInterface
|
||||
* @throws \Http\Client\Exception
|
||||
*/
|
||||
public function request(
|
||||
$method,
|
||||
$uri,
|
||||
array $headers = [],
|
||||
$body = null,
|
||||
$protocolVersion = '1.1'
|
||||
) {
|
||||
$request = $this->requestFactory->createRequest($method, $uri, $headers, $body, $protocolVersion);
|
||||
|
||||
return $this->sendRequest($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestInterface $request
|
||||
* @return ResponseInterface
|
||||
* @throws \Http\Client\Exception
|
||||
*/
|
||||
private function sendRequest(RequestInterface $request)
|
||||
{
|
||||
try {
|
||||
return $this->httpClient->sendRequest($request);
|
||||
} catch (\Http\Client\Exception\NetworkException $networkException) {
|
||||
throw new NetworkException($networkException->getMessage(), $request, $networkException);
|
||||
} catch (\Exception $exception) {
|
||||
throw new RequestException($exception->getMessage(), $request, $exception);
|
||||
}
|
||||
parent::__construct($httpClient, $requestFactory);
|
||||
}
|
||||
}
|
||||
|
||||
18
vendor/omnipay/common/src/Common/Http/PsrClient.php
vendored
Normal file
18
vendor/omnipay/common/src/Common/Http/PsrClient.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Common\Http;
|
||||
|
||||
use Psr\Http\Client\ClientInterface as HttpClientInterface;
|
||||
use Psr\Http\Message\RequestFactoryInterface;
|
||||
use Psr\Http\Message\StreamFactoryInterface;
|
||||
|
||||
class PsrClient extends AbstractClient
|
||||
{
|
||||
public function __construct(
|
||||
?HttpClientInterface $httpClient = null,
|
||||
?RequestFactoryInterface $requestFactory = null,
|
||||
?StreamFactoryInterface $streamFactory = null
|
||||
) {
|
||||
parent::__construct($httpClient, $requestFactory, $streamFactory);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@
|
||||
use Omnipay\Common\Exception\InvalidRequestException;
|
||||
use Omnipay\Common\Exception\RuntimeException;
|
||||
use Omnipay\Common\Helper;
|
||||
use Omnipay\Common\Http\Client;
|
||||
use Omnipay\Common\Http\ClientInterface;
|
||||
use Omnipay\Common\ItemBag;
|
||||
use Omnipay\Common\ParametersTrait;
|
||||
|
||||
0
vendor/omnipay/common/src/Common/Message/NotificationInterface.php
vendored
Normal file → Executable file
0
vendor/omnipay/common/src/Common/Message/NotificationInterface.php
vendored
Normal file → Executable file
Reference in New Issue
Block a user