Skip to content

Commit f4bd3a7

Browse files
Merge pull request #86 from pagarme/develop
Release 2.1.0
2 parents 9c7fa16 + 78654e7 commit f4bd3a7

File tree

102 files changed

+629
-346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+629
-346
lines changed

composer.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pagarme/ecommerce-module-core",
33
"description": "Core component for Pagar.me e-commerce platform modules.",
44
"license": "MIT",
5-
"version": "1.2.0",
5+
"version": "2.1.0",
66
"authors": [
77
{
88
"name":"Open Source Team"
@@ -11,15 +11,15 @@
1111
"type": "library",
1212
"require": {
1313
"php": ">=7.1",
14-
"monolog/monolog": "*",
15-
"pagarme/pagarmecoreapi": "^5.7",
14+
"monolog/monolog": "<3",
15+
"pagarme/pagarmecoreapi": "5.6.1",
1616
"ext-json": "*"
1717
},
1818
"require-dev": {
1919
"mockery/mockery": "1.2.4",
2020
"nesbot/carbon": "1.39.0",
2121
"ext-pdo": "*",
22-
"phpunit/phpunit": "5.7.27"
22+
"phpunit/phpunit": "^5 | ^6 | ^7 | ^8 | ^9"
2323
},
2424
"autoload": {
2525
"psr-4": {
@@ -37,5 +37,10 @@
3737
],
3838
"tests": "vendor/bin/phpunit --colors=always",
3939
"tests-coverage": "vendor/bin/phpunit --colors=always --coverage-html ./tests/report"
40+
},
41+
"config": {
42+
"allow-plugins": {
43+
"kylekatarnls/update-helper": true
44+
}
4045
}
4146
}

src/Hub/Aggregates/InstallToken.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,7 @@ public function setDisabled($isDisabled)
132132
{
133133
}
134134

135-
/**
136-
*
137-
* @return array|mixed
138-
*/
135+
#[\ReturnTypeWillChange]
139136
public function jsonSerialize()
140137
{
141138
$obj = new \stdClass();

src/Hub/Commands/CommandType.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class CommandType extends AbstractValueObject
1212

1313
/**
1414
*
15-
* @var string
15+
* @var string
1616
*/
1717
private $value;
1818

@@ -58,7 +58,7 @@ private function setValue($value)
5858

5959
/**
6060
*
61-
* @var static $object
61+
* @var static $object
6262
*/
6363
public function isEqual($object)
6464
{
@@ -72,8 +72,9 @@ public function isEqual($object)
7272
* which is a value of any type other than a resource.
7373
* @since 5.4.0
7474
*/
75+
#[\ReturnTypeWillChange]
7576
public function jsonSerialize()
7677
{
7778
return $this->value;
7879
}
79-
}
80+
}

src/Kernel/Aggregates/Charge.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ final class Charge extends AbstractEntity implements ChargeInterface
1717

1818
/**
1919
*
20-
* @var OrderId
20+
* @var OrderId
2121
*/
2222
private $orderId;
2323
/**
2424
*
25-
* @var int
25+
* @var int
2626
*/
2727
private $amount;
2828
/**
2929
*
30-
* @var int
30+
* @var int
3131
*/
3232
private $paidAmount;
3333
/**
@@ -45,18 +45,18 @@ final class Charge extends AbstractEntity implements ChargeInterface
4545

4646
/**
4747
*
48-
* @var string
48+
* @var string
4949
*/
5050
private $code;
5151
/**
5252
*
53-
* @var ChargeStatus
53+
* @var ChargeStatus
5454
*/
5555
private $status;
5656

5757
/**
5858
*
59-
* @var Transaction[]
59+
* @var Transaction[]
6060
*/
6161
private $transactions;
6262

@@ -456,6 +456,7 @@ public function getCustomerId()
456456
* which is a value of any type other than a resource.
457457
* @since 5.4.0
458458
*/
459+
#[\ReturnTypeWillChange]
459460
public function jsonSerialize()
460461
{
461462
$obj = new \stdClass();
@@ -475,4 +476,4 @@ public function jsonSerialize()
475476

476477
return $obj;
477478
}
478-
}
479+
}

src/Kernel/Aggregates/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ public function setBoletoDueDays($boletoDueDays)
705705
if (!is_numeric($boletoDueDays)) {
706706
throw new InvalidParamException("Boleto due days should be an integer!", $boletoDueDays);
707707
}
708-
708+
709709
$this->boletoDueDays = (int) $boletoDueDays;
710710
}
711711

@@ -733,6 +733,7 @@ public function setBoletoBankCode($boletoBankCode)
733733
* which is a value of any type other than a resource.
734734
* @since 5.4.0
735735
*/
736+
#[\ReturnTypeWillChange]
736737
public function jsonSerialize()
737738
{
738739
return [

src/Kernel/Aggregates/LogObject.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public function setVersions($versions)
9696
* which is a value of any type other than a resource.
9797
* @since 5.4.0
9898
*/
99+
#[\ReturnTypeWillChange]
99100
public function jsonSerialize()
100101
{
101102
$baseObject = new \stdClass();
@@ -106,4 +107,4 @@ public function jsonSerialize()
106107

107108
return $baseObject;
108109
}
109-
}
110+
}

src/Kernel/Aggregates/Order.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ final class Order extends AbstractEntity
1515

1616
/**
1717
*
18-
* @var PlatformOrderInterface
18+
* @var PlatformOrderInterface
1919
*/
2020
private $platformOrder;
2121

2222
/**
2323
*
24-
* @var OrderStatus
24+
* @var OrderStatus
2525
*/
2626
private $status;
2727
/**
2828
*
29-
* @var Charge[]
29+
* @var Charge[]
3030
*/
3131
private $charges;
3232

@@ -170,7 +170,7 @@ public function addCharge(ChargeInterface $newCharge)
170170
$charges[] = $newCharge;
171171
$this->charges = $charges;
172172

173-
return $this;
173+
return $this;
174174
}
175175

176176
public function updateCharge(ChargeInterface $updatedCharge, $overwriteId = false)
@@ -200,6 +200,7 @@ public function updateCharge(ChargeInterface $updatedCharge, $overwriteId = fals
200200
* which is a value of any type other than a resource.
201201
* @since 5.4.0
202202
*/
203+
#[\ReturnTypeWillChange]
203204
public function jsonSerialize()
204205
{
205206
$obj = new \stdClass();
@@ -214,4 +215,4 @@ public function jsonSerialize()
214215

215216
return $obj;
216217
}
217-
}
218+
}

src/Kernel/Aggregates/Transaction.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class Transaction extends AbstractEntity
1818
private $transactionType;
1919
/**
2020
*
21-
* @var int
21+
* @var int
2222
*/
2323
private $amount;
2424
/**
@@ -29,23 +29,23 @@ final class Transaction extends AbstractEntity
2929

3030
/**
3131
*
32-
* @var TransactionStatus
32+
* @var TransactionStatus
3333
*/
3434
private $status;
3535
/**
3636
*
37-
* @var \DateTime
37+
* @var \DateTime
3838
*/
3939
private $createdAt;
4040
/**
4141
*
42-
* @var ChargeId
42+
* @var ChargeId
4343
*/
4444
private $chargeId;
4545

4646
/**
4747
*
48-
* @var string
48+
* @var string
4949
*/
5050
private $acquirerName;
5151
/**
@@ -65,19 +65,19 @@ final class Transaction extends AbstractEntity
6565
private $acquirerAuthCode;
6666
/**
6767
*
68-
* @var string
68+
* @var string
6969
*/
7070
private $acquirerMessage;
7171

7272
/**
7373
*
74-
* @var string
74+
* @var string
7575
*/
7676
private $brand;
7777

7878
/**
7979
*
80-
* @var int
80+
* @var int
8181
*/
8282
private $installments;
8383

@@ -398,6 +398,7 @@ public function setPostData($postData)
398398
* which is a value of any type other than a resource.
399399
* @since 5.4.0
400400
*/
401+
#[\ReturnTypeWillChange]
401402
public function jsonSerialize()
402403
{
403404
$obj = new \stdClass();
@@ -441,4 +442,4 @@ public function setCardData($cardData)
441442
$this->cardData = $cardData;
442443
return $this;
443444
}
444-
}
445+
}

src/Kernel/Exceptions/AbstractPagarmeCoreException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ abstract class AbstractPagarmeCoreException
1717
* which is a value of any type other than a resource.
1818
* @since 5.4.0
1919
*/
20+
#[\ReturnTypeWillChange]
2021
public function jsonSerialize()
2122
{
2223
$obj = new \stdClass();
@@ -30,4 +31,4 @@ public function jsonSerialize()
3031

3132
return $obj;
3233
}
33-
}
34+
}

src/Kernel/Helper/StringFunctionsHelper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ public function cleanStrToDb($str)
153153
*/
154154
public static function removeLineBreaks($text)
155155
{
156+
if($text === null) {
157+
return "";
158+
}
156159
$pattern = '/\\\s+\\\s\\\r\\\n|\\\r|\\\t|\\\n\\\r|\\\n/m';
157160
$textCleanBreakLines = trim(
158161
preg_replace(

0 commit comments

Comments
 (0)