Skip to content

Commit

Permalink
Merge dcec4a5 into 46dd458
Browse files Browse the repository at this point in the history
  • Loading branch information
ashkarpetin committed Mar 14, 2019
2 parents 46dd458 + dcec4a5 commit 9a0ab62
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ _TBD_
- [x] Added new property to `PaymentCardToken`: `isUsed`
- [x] Added new blacklist types to `Blacklist`: `email-domain`, `bank-account`, `address`
- [x] Added new `taxCategory` to `Product`
- [x] Added new property to `Blacklist`: `expirationTime`.

### Changed
- [x] **Upgraded minimum PHP version to 7.1**

### Deprecated
- [x] Deprecated `Customer` entity methods: `getFirstName`, `setFirstName`, `getLastName`, `setLastName`, `getEmail`, `setEmail`
- [x] Deprecated `Blacklist` `expiredTime` property.

## [2.3.0] 2018-10-08

Expand Down
36 changes: 30 additions & 6 deletions src/Entities/Blacklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,44 +103,68 @@ public function setValue($value)

/**
* @deprecated The method is deprecated and will be removed in next version.
* @see Blacklist::getExpiredTime()
* @see Blacklist::getExpirationTime()
*
* @return mixed
*/
public function getExpireTime()
{
return $this->getAttribute('expireTime');
return $this->getExpirationTime();
}

/**
* @deprecated The method is deprecated and will be removed in next version.
* @see Blacklist::setExpiredTime()
* @see Blacklist::setExpirationTime()
*
* @param mixed $value
*
* @return $this
*/
public function setExpireTime($value)
{
return $this->setAttribute('expireTime', $value);
return $this->setExpirationTime($value);
}

/**
* @deprecated The method is deprecated and will be removed in next version.
* @see Blacklist::getExpirationTime()
*
* @return mixed
*/
public function getExpiredTime()
{
return $this->getAttribute('expiredTime');
return $this->getExpirationTime();
}

/**
* @deprecated The method is deprecated and will be removed in next version.
* @see Blacklist::setExpirationTime()
*
* @param mixed $value
*
* @return $this
*/
public function setExpiredTime($value)
{
return $this->setAttribute('expiredTime', $value);
return $this->setExpirationTime($value);
}

/**
* @return mixed
*/
public function getExpirationTime()
{
return $this->getAttribute('expirationTime');
}

/**
* @param mixed $value
*
* @return $this
*/
public function setExpirationTime($value)
{
return $this->setAttribute('expirationTime', $value);
}

/**
Expand Down
9 changes: 7 additions & 2 deletions tests/Api/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class ApiTest extends TestCase
*
* @param string $class
* @param string $id
* @param array $exclude
*/
public function buildJson($class, $id = 'id')
public function buildJson($class, $id = 'id', $exclude = [])
{
$getters = [];
$setters = [];
Expand All @@ -51,6 +52,10 @@ public function buildJson($class, $id = 'id')
$prefix = substr($method, 0, 3);
$attribute = lcfirst(substr($method, 3));

if (in_array($attribute, $exclude, true)) {
continue;
}

if ($prefix === 'get') {
$getters[$attribute] = $method;
} elseif ($prefix === 'set') {
Expand Down Expand Up @@ -131,7 +136,7 @@ public function provideEntityClasses()
[Entities\Attachment::class],
[Entities\AuthenticationOptions::class, null],
[Entities\AuthenticationToken::class, 'token'],
[Entities\Blacklist::class],
[Entities\Blacklist::class, 'id', ['expireTime', 'expiredTime']],
[Entities\Contact::class],
[Entities\Contact\Email::class],
[Entities\Contact\PhoneNumber::class],
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected function getFakeValue($attribute, $class)
return $faker->uuid;
case 'dueTime':
case 'expiredTime':
case 'expireTime': // TODO inconsistent name
case 'expirationTime':
case 'periodStartTime':
case 'renewalTime':
case 'periodEndTime':
Expand Down

0 comments on commit 9a0ab62

Please sign in to comment.