Skip to content

Commit 4aa0c40

Browse files
committed
style ci
1 parent 388c2fe commit 4aa0c40

17 files changed

+96
-63
lines changed

.github/workflows/tests.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,54 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: [ '7.1','7.2', '7.3', '7.4', '8.0', '8.1' ]
13-
stability: [ prefer-stable ]
12+
php: [ '7.1','7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
1413

15-
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
14+
name: PHP ${{ matrix.php }}
15+
16+
env:
17+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, fileinfo
18+
key: cache-v1 # can be any string, change to clear the extension cache.
1619

1720
steps:
1821
- name: Checkout code
19-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
23+
24+
- name: Setup cache environment
25+
id: extcache
26+
uses: shivammathur/cache-extensions@v1
27+
with:
28+
php-version: ${{ matrix.php }}
29+
extensions: ${{ env.extensions }}
30+
key: ${{ env.key }}
31+
32+
- name: Cache extensions
33+
uses: actions/cache@v3
34+
with:
35+
path: ${{ steps.extcache.outputs.dir }}
36+
key: ${{ steps.extcache.outputs.key }}
37+
restore-keys: ${{ steps.extcache.outputs.key }}
2038

2139
- name: Setup PHP
2240
uses: shivammathur/setup-php@v2
2341
with:
2442
php-version: ${{ matrix.php }}
25-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, memcached
43+
extensions: ${{ env.extensions }}
2644
tools: composer:v2
27-
coverage: none
45+
coverage: xdebug
2846

29-
- name: Install dependencies
30-
uses: nick-invision/retry@v1
47+
- name: Get Composer Cache Directory
48+
id: composer-cache
49+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
50+
51+
- name: Cache Composer dependencies
52+
uses: actions/cache@v3
3153
with:
32-
timeout_minutes: 5
33-
max_attempts: 5
34-
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }}
54+
path: ${{ steps.composer-cache.outputs.dir }}
55+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
56+
restore-keys: ${{ runner.os }}-composer-
57+
58+
- name: Install Composer dependencies
59+
run: composer install --prefer-dist --no-interaction --no-progress
3560

3661
- name: Execute tests
37-
continue-on-error: ${{ matrix.php > 8 }}
38-
run: vendor/bin/phpunit --verbose
62+
run: vendor/bin/phpunit --testdox --verbose

src/Gateway.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
* echo "Transaction reference = " . $sale_id . "\n";
6969
* }
7070
* </code>
71+
*
7172
* @method RequestInterface authorize(array $options = [])
7273
* @method RequestInterface completeAuthorize(array $options = [])
7374
* @method RequestInterface capture(array $options = [])
@@ -106,7 +107,7 @@ public function getDefaultParameters()
106107
}
107108

108109
/**
109-
* @param array $options
110+
* @param array $options
110111
* @return RequestInterface
111112
*/
112113
public function purchase(array $options = [])
@@ -115,7 +116,7 @@ public function purchase(array $options = [])
115116
}
116117

117118
/**
118-
* @param array $options
119+
* @param array $options
119120
* @return RequestInterface
120121
*/
121122
public function completePurchase(array $options = [])
@@ -126,7 +127,7 @@ public function completePurchase(array $options = [])
126127
}
127128

128129
/**
129-
* @param array $options
130+
* @param array $options
130131
* @return RequestInterface|NotificationInterface
131132
*/
132133
public function acceptNotification(array $options = [])
@@ -135,7 +136,7 @@ public function acceptNotification(array $options = [])
135136
}
136137

137138
/**
138-
* @param array $options
139+
* @param array $options
139140
* @return RequestInterface
140141
*/
141142
public function receiveTransactionInfo(array $options = [])

src/Message/AcceptNotificationRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class AcceptNotificationRequest extends CompletePurchaseRequest implements NotificationInterface
88
{
99
/**
10-
* @param mixed $data
10+
* @param mixed $data
1111
* @return AcceptNotificationResponse
1212
*/
1313
public function sendData($data)

src/Message/CompletePurchaseRequest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CompletePurchaseRequest extends AbstractRequest
1818
use HasCVS;
1919

2020
/**
21-
* @param int $authAmount
21+
* @param int $authAmount
2222
* @return CompletePurchaseRequest
2323
*/
2424
public function setAuthAmount($authAmount)
@@ -35,7 +35,7 @@ public function getAuthAmount()
3535
}
3636

3737
/**
38-
* @param string $rtnCode
38+
* @param string $rtnCode
3939
* @return CompletePurchaseRequest
4040
*/
4141
public function setRtnCode($rtnCode)
@@ -52,7 +52,7 @@ public function getRtnCode()
5252
}
5353

5454
/**
55-
* @param string $rtnMsg
55+
* @param string $rtnMsg
5656
* @return CompletePurchaseRequest
5757
*/
5858
public function setRtnMsg($rtnMsg)
@@ -69,7 +69,7 @@ public function getRtnMsg()
6969
}
7070

7171
/**
72-
* @param string $paymentDate
72+
* @param string $paymentDate
7373
* @return CompletePurchaseRequest
7474
*/
7575
public function setPaymentDate($paymentDate)
@@ -103,7 +103,7 @@ public function getTransferOutAccount()
103103
}
104104

105105
/**
106-
* @param string $checkMacValue
106+
* @param string $checkMacValue
107107
* @return CompletePurchaseRequest
108108
*/
109109
public function setCheckMacValue($checkMacValue)
@@ -145,7 +145,7 @@ public function getData()
145145
}
146146

147147
/**
148-
* @param mixed $data
148+
* @param mixed $data
149149
* @return CompletePurchaseResponse
150150
*/
151151
public function sendData($data)
@@ -155,6 +155,7 @@ public function sendData($data)
155155

156156
/**
157157
* @return array
158+
*
158159
* @throws InvalidResponseException
159160
*/
160161
private function checkMacValue($data)

src/Message/PurchaseRequest.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PurchaseRequest extends AbstractRequest
1111
use HasMerchant;
1212

1313
/**
14-
* @param string $orderNo
14+
* @param string $orderNo
1515
* @return PurchaseRequest
1616
*/
1717
public function setOrderNo($orderNo)
@@ -28,7 +28,7 @@ public function getOrderNo()
2828
}
2929

3030
/**
31-
* @param string $receiveUrl
31+
* @param string $receiveUrl
3232
* @return PurchaseRequest
3333
*/
3434
public function setReceiveUrl($receiveUrl)
@@ -45,7 +45,7 @@ public function getReceiveUrl()
4545
}
4646

4747
/**
48-
* @param string $orderDesc
48+
* @param string $orderDesc
4949
* @return PurchaseRequest
5050
*/
5151
public function setOrderDesc($orderDesc)
@@ -62,7 +62,7 @@ public function getOrderDesc()
6262
}
6363

6464
/**
65-
* @param string $cardHolder
65+
* @param string $cardHolder
6666
* @return PurchaseRequest
6767
*/
6868
public function setCardHolder($cardHolder)
@@ -79,7 +79,7 @@ public function getCardHolder()
7979
}
8080

8181
/**
82-
* @param string $mobile
82+
* @param string $mobile
8383
* @return PurchaseRequest
8484
*/
8585
public function setMobile($mobile)
@@ -96,7 +96,7 @@ public function getMobile()
9696
}
9797

9898
/**
99-
* @param string $telNumber
99+
* @param string $telNumber
100100
* @return PurchaseRequest
101101
*/
102102
public function setTelNumber($telNumber)
@@ -113,7 +113,7 @@ public function getTelNumber()
113113
}
114114

115115
/**
116-
* @param string $email
116+
* @param string $email
117117
* @return PurchaseRequest
118118
*/
119119
public function setEmail($email)
@@ -130,7 +130,7 @@ public function getEmail()
130130
}
131131

132132
/**
133-
* @param string $address
133+
* @param string $address
134134
* @return PurchaseRequest
135135
*/
136136
public function setAddress($address)
@@ -147,7 +147,7 @@ public function getAddress()
147147
}
148148

149149
/**
150-
* @param string $memberId
150+
* @param string $memberId
151151
* @return PurchaseRequest
152152
*/
153153
public function setMemberId($memberId)
@@ -170,7 +170,7 @@ public function getMemberId()
170170
* Ibon、Famiport目前最大值為7天
171171
* ※僅限付款方式為2.3.4.6。
172172
*
173-
* @param string $deadlineDate
173+
* @param string $deadlineDate
174174
* @return PurchaseRequest
175175
*/
176176
public function setDeadlineDate($deadlineDate)
@@ -189,7 +189,7 @@ public function getDeadlineDate()
189189
}
190190

191191
/**
192-
* @param string $deadlineTime
192+
* @param string $deadlineTime
193193
* @return PurchaseRequest
194194
*/
195195
public function setDeadlineTime($deadlineTime)
@@ -206,7 +206,7 @@ public function getDeadlineTime()
206206
}
207207

208208
/**
209-
* @param string $deadlineTime
209+
* @param string $deadlineTime
210210
* @return PurchaseRequest
211211
*/
212212
public function setUSN($deadlineTime)
@@ -224,6 +224,7 @@ public function getUSN()
224224

225225
/**
226226
* @return array
227+
*
227228
* @throws InvalidRequestException
228229
*/
229230
public function getData()
@@ -254,7 +255,7 @@ public function getData()
254255
}
255256

256257
/**
257-
* @param array $data
258+
* @param array $data
258259
* @return PurchaseResponse
259260
*/
260261
public function sendData($data)

src/Message/PurchaseResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class PurchaseResponse extends AbstractResponse implements RedirectResponseInter
1717
/**
1818
* Constructor.
1919
*
20-
* @param PurchaseRequest $request the initiating request.
21-
* @param mixed $data
20+
* @param PurchaseRequest $request the initiating request.
21+
* @param mixed $data
2222
*/
2323
public function __construct(PurchaseRequest $request, $data)
2424
{

src/Message/ReceiveTransactionInfoRequest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ReceiveTransactionInfoRequest extends AbstractRequest
1818
use HasCVS;
1919

2020
/**
21-
* @param string $payEndDate
21+
* @param string $payEndDate
2222
* @return ReceiveTransactionInfoRequest
2323
*/
2424
public function setPayEndDate($payEndDate)
@@ -36,6 +36,7 @@ public function getPayEndDate()
3636

3737
/**
3838
* @return array
39+
*
3940
* @throws InvalidRequestException
4041
*/
4142
public function getData()
@@ -57,7 +58,7 @@ public function getData()
5758
}
5859

5960
/**
60-
* @param mixed $data
61+
* @param mixed $data
6162
* @return ResponseInterface
6263
*/
6364
public function sendData($data)

src/Support/Helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
class Helper
66
{
77
/**
8-
* @param string $date
9-
* @param string $format
8+
* @param string $date
9+
* @param string $format
1010
* @return string
1111
*/
1212
public static function parseDate($date, $format = null)

src/Traits/HasBooking.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
trait HasBooking
66
{
77
/**
8-
* @param string $bookingId
8+
* @param string $bookingId
99
* @return $this
1010
*/
1111
public function setBookingId($bookingId)
@@ -22,7 +22,7 @@ public function getBookingId()
2222
}
2323

2424
/**
25-
* @param string $custOrderNo
25+
* @param string $custOrderNo
2626
* @return $this
2727
*/
2828
public function setCustOrderNo($custOrderNo)
@@ -39,7 +39,7 @@ public function getCustOrderNo()
3939
}
4040

4141
/**
42-
* @param string $sendType
42+
* @param string $sendType
4343
* @return $this
4444
*/
4545
public function setSendType($sendType)

0 commit comments

Comments
 (0)