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

Commit

Permalink
Removed mcrypt from composer, fixed datetime invoice setting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Pieter Poorthuis committed Nov 28, 2017
1 parent 2ea2418 commit 34e2464
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 268 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.2.15] - 2017-11-28
### Fixed
- Fixed invoice time being set as numeric instead of datetime object

### Removed
- Removed support for mcrypt (#254)


## [2.2.14] - 2017-09-27
### Fixed
- Fixed token check in get invoices method for public facade calls (#243)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.14
2.2.15
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"ext-curl": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-mcrypt": "*",
"symfony/config": "^2.3 || ^3.0",
"symfony/dependency-injection": "^2.3 || ^3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Bitpay/Client/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface ClientInterface
* @see RFC2616 section 14.43 for User-Agent Format
*/
const NAME = 'BitPay PHP-Client';
const VERSION = '0.0.0';
const VERSION = '2.2.15';

//public function createApplication(ApplicationInterface $application);

Expand Down
175 changes: 0 additions & 175 deletions src/Bitpay/Crypto/McryptExtension.php

This file was deleted.

21 changes: 15 additions & 6 deletions src/Bitpay/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,13 @@ public function getInvoiceTime()
*/
public function setInvoiceTime($invoiceTime)
{
if (!empty($invoiceTime)) {
if (is_a($invoiceTime, 'DateTime')) {
$this->invoiceTime = $invoiceTime;
} else if (is_numeric($invoiceTime)) {
$invoiceDateTime = new \DateTime();
$invoiceDateTime->setTimestamp($invoiceTime);
$this->invoiceTime = $invoiceDateTime;
}

return $this;
}

Expand All @@ -492,10 +495,13 @@ public function getExpirationTime()
*/
public function setExpirationTime($expirationTime)
{
if (!empty($expirationTime)) {
if (is_a($expirationTime, 'DateTime')) {
$this->expirationTime = $expirationTime;
} else if (is_numeric($expirationTime)) {
$expirationDateTime = new \DateTime();
$expirationDateTime->setTimestamp($expirationTime);
$this->expirationTime = $expirationDateTime;
}

return $this;
}

Expand All @@ -514,10 +520,13 @@ public function getCurrentTime()
*/
public function setCurrentTime($currentTime)
{
if (!empty($currentTime)) {
if (is_a($currentTime, 'DateTime')) {
$this->currentTime = $currentTime;
} else if (is_numeric($currentTime)) {
$currentDateTime = new \DateTime();
$currentDateTime->setTimestamp($currentTime);
$this->currentTime = $currentDateTime;
}

return $this;
}

Expand Down
7 changes: 0 additions & 7 deletions src/Bitpay/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,6 @@ public static function checkRequirements()
$requirements['PHP'] = true;
}

// Mcrypt Extension
if (!extension_loaded('mcrypt')) {
$requirements['Mcrypt'] = 'The Mcrypt PHP extension could not be found.';
} else {
$requirements['Mcrypt'] = true;
}

// OpenSSL Extension
if (!extension_loaded('openssl')) {
$requirements['OpenSSL'] = 'The OpenSSL PHP extension could not be found.';
Expand Down
70 changes: 0 additions & 70 deletions tests/Bitpay/Crypto/McryptExtensionTest.php

This file was deleted.

7 changes: 0 additions & 7 deletions tests/Bitpay/Util/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,6 @@ public function testCheckRequirements()
$this->assertTrue(is_string($requirements['PHP']));
}

// Mcrypt Extension
if (extension_loaded('mcrypt')) {
$this->assertTrue($requirements['Mcrypt']);
} else {
$this->assertTrue(is_string($requirements['Mcrypt']));
}

// OpenSSL Extension
if (extension_loaded('openssl')) {
$this->assertTrue($requirements['OpenSSL']);
Expand Down

0 comments on commit 34e2464

Please sign in to comment.