Skip to content

Commit ddabff2

Browse files
Merge pull request php-vcr#334 from specialtactics/feature/ssl-paypal
Support for ssl requests in some edge cases like paypal php sdk
2 parents c482b6e + 1f5e709 commit ddabff2

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ parameters:
22
level: 7
33
paths:
44
- src
5+
# Can remove reportUnmatchedIgnoredErrors option after php 7.2 is no longer supported
6+
reportUnmatchedIgnoredErrors: false
57
ignoreErrors:
68
# This part of PHP is not very well documented, resulting PHPStan's definitions not being accurate
79
- "#Access to an undefined property object::\\$data\\.#"
@@ -14,6 +16,8 @@ parameters:
1416
# The EventDispatcherInterface::dispatch signature is different (!) between Symfony <4.3 and >=4.3
1517
- '/Parameter #1 \$event of method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) expects object, string\|null given./'
1618
- '/Parameter #2 \$eventName of method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) expects string\|null, VCR\\Event\\Event given./'
19+
# PHPStan cannot deal with manually defined constants - can be removed once php 7.2 no longer supported
20+
- '#Constant CURLPROXY_HTTPS not found.#'
1721
includes:
1822
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
1923
- vendor/phpstan/phpstan-beberlei-assert/extension.neon

src/VCR/Util/CurlHelper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ public static function getCurlOptionFromResponse(Response $response, int $option
111111
case CURLINFO_HEADER_SIZE:
112112
$info = mb_strlen(HttpUtil::formatAsStatusWithHeadersString($response), 'ISO-8859-1');
113113
break;
114+
case CURLPROXY_HTTPS:
115+
$info = '';
116+
break;
114117
default:
115118
$info = $response->getCurlInfo(self::$curlInfoList[$option]);
116119
break;

src/VCR/VCRFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ class VCRFactory
3232
protected function __construct(Configuration $config = null)
3333
{
3434
$this->config = $config ?: $this->getOrCreate('VCR\Configuration');
35+
36+
// This constant exists only from PHP 7.3
37+
// Once we are no longer supporting 7.2, we can remove this
38+
\defined('CURLPROXY_HTTPS') or \define('CURLPROXY_HTTPS', 2);
3539
}
3640

3741
protected function createVCRVideorecorder(): Videorecorder

0 commit comments

Comments
 (0)