Skip to content
This repository was archived by the owner on Jan 22, 2021. It is now read-only.

Allow HTTP2 response #289

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ php:
- 7.0
- 7.1
- 7.2
- 7.3

install:
- composer install
Expand Down
1 change: 0 additions & 1 deletion build/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="docs/code-coverage"/>
<log type="coverage-clover" target="logs/clover.xml"/>
</logging>
</phpunit>
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"fabpot/goutte": "~1.0.4",
"behat/mink-goutte-driver": "1.*",
"phpmd/phpmd": "~2.1.3",
"phpunit/phpunit": "~4.8.35",
"phpunit/phpunit": "~5.7.9",
"fzaninotto/faker": "~1.4.0",
"mikey179/vfsStream": "~1.4.0",
"squizlabs/php_codesniffer": "~1.5.5",
"mikey179/vfsstream": "~1.4.0",
"squizlabs/php_codesniffer": "~3.4",
"satooshi/php-coveralls": "~0.6.1",
"symfony/phpunit-bridge": "^4.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/AccessTokenInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2015 BitPay Inc., MIT License
* @license Copyright 2011-2015 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
18 changes: 1 addition & 17 deletions src/Bitpay/Application.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2015 BitPay Inc., MIT License
* @license Copyright 2011-2015 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down Expand Up @@ -61,20 +61,4 @@ public function addUser(UserInterface $user)

return $this;
}

/**
* Add org to stack
*
* @param OrgInterface $org
*
* @return ApplicationInterface
*/
public function addOrg(OrgInterface $org)
{
if (!empty($org)) {
$this->orgs[] = $org;
}

return $this;
}
}
2 changes: 1 addition & 1 deletion src/Bitpay/ApplicationInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Bill.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/BillInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Bitpay.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Buyer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/BuyerInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/ArgumentException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php

namespace Bitpay\Client;

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/BitpayException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php

namespace Bitpay\Client;

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ protected function checkPriceAndCurrency($price, $currency)
if (($currency != 'BCH' && $currency != 'BTC') && $decimalPrecision > 2) {
throw new \Bitpay\Client\BitpayException('Incorrect price format or currency type.');
}
elseif ($decimalPrecision > 6) {
if ($decimalPrecision > 6) {
throw new \Bitpay\Client\BitpayException('Incorrect price format or currency type.');
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/ClientInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/ConnectionException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php

namespace Bitpay\Client;

Expand Down
4 changes: 2 additions & 2 deletions src/Bitpay/Client/Request.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down Expand Up @@ -52,7 +52,7 @@ class Request implements RequestInterface
protected $path;

/**
* Default is 443 but should be changed by whatever is passed in through the Adapter.
* Default is 443 but should be changed by whatever is passed in through the Adapter.
*
* @var integer
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/RequestInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
4 changes: 2 additions & 2 deletions src/Bitpay/Client/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public static function createFromRawResponse($rawResponse)

for ($i = 0; $i < $linesLen; $i++) {
if (0 == $i) {
preg_match('/^HTTP\/(\d\.\d)\s(\d+)\s(.+)/', $lines[$i], $statusLine);
preg_match('#^HTTP/[0-9\\.]+\s(\d+)#', $lines[$i], $statusLine);

$response->setStatusCode($statusCode = $statusLine[2]);
$response->setStatusCode($statusCode = $statusLine[1]);

continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/ResponseInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Crypto/CryptoInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Crypto/HashExtension.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
3 changes: 1 addition & 2 deletions src/Bitpay/Crypto/OpenSSLExtension.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down Expand Up @@ -242,7 +242,6 @@ public function decrypt($encrypted_text, $key = '', $iv = '', $bit_check = 8, $c
try {
/* Ensure the key & IV is the same for both encrypt & decrypt. */
if (!empty($encrypted_text)) {

$decrypted = openssl_decrypt(base64_decode($encrypted_text), $cipher_type, $key, 0, $iv);
$last_char = substr($decrypted, -1);

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/CurrencyInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/DependencyInjection/Loader/ArrayLoader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
4 changes: 2 additions & 2 deletions src/Bitpay/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ public function getPaymentSubtotals()
}

/**
* @param
* @param array
* @return InvoiceInterface
*/
public function setPaymentSubtotals($paymentSubtotals)
Expand All @@ -800,7 +800,7 @@ public function getPaymentTotals()
}

/**
* @param
* @param array
* @return InvoiceInterface
*/
public function setPaymentTotals($paymentTotals)
Expand Down
1 change: 0 additions & 1 deletion src/Bitpay/InvoiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,5 +369,4 @@ public function getPaymentTotals();
public function getAmountPaid();

public function getExchangeRates();

}
4 changes: 2 additions & 2 deletions src/Bitpay/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ public function setPhysical($physical)
*/
protected function checkPriceFormat($price)
{
if($price === '0') {
if ($price === '0') {
return;
}
$converted = (float)$price;
if($converted == 0) {
if ($converted == 0) {
throw new \Bitpay\Client\ArgumentException("Price must be formatted as a float ". $converted);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/ItemInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Key.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/KeyInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/KeyManager.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
8 changes: 3 additions & 5 deletions src/Bitpay/Math/BcEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public function invertm($num, $mod)
$x = $y;

$y = $tmp;

} while (bccomp($num1, '0'));

if (bccomp($x, '0') < 0) {
Expand Down Expand Up @@ -168,13 +167,12 @@ public function input($x)
}

return $sign.$dec;

} elseif (preg_match('/^-?[0-9]+$/', $x)) {
}
if (preg_match('/^-?[0-9]+$/', $x)) {
return $x;
} else {
throw new \Exception("The input must be a numeric string in decimal or hexadecimal (with leading 0x) format.\n".var_export($x, true));
}

throw new \Exception("The input must be a numeric string in decimal or hexadecimal (with leading 0x) format.\n".var_export($x, true));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Network/Customnet.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Network/Livenet.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Network/NetworkAware.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Network/NetworkAwareInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Network/NetworkInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Network/Testnet.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
*/

Expand Down
Loading