@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Radowoj\Yaah; |
4 | 4 | |
5 | -use PHPUnit\Framework\TestCase; |
|
5 | +use PHPUnit\Framework\TestCase; |
|
6 | 6 | use Radowoj\Yaah\Field; |
7 | 7 | |
8 | 8 | class FieldTest extends TestCase |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Sets photos for auction |
24 | - * @param array $photos array of photo file paths |
|
24 | + * @param string[] $photos array of photo file paths |
|
25 | 25 | */ |
26 | 26 | public function setPhotos(array $photos) |
27 | 27 | { |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Radowoj\Yaah; |
4 | 4 | |
5 | -use PHPUnit\Framework\TestCase; |
|
6 | -use Radowoj\Yaah\Field; |
|
5 | +use PHPUnit\Framework\TestCase; |
|
7 | 6 | use SoapClient; |
8 | 7 | |
9 | 8 | class HelperTest extends TestCase |
@@ -143,7 +143,7 @@ |
||
143 | 143 | $this->soapClient->expects($this->once()) |
144 | 144 | ->method('doSomethingNotImplementedInHelper') |
145 | 145 | ->with( |
146 | - $this->callback(function($params){ |
|
146 | + $this->callback(function($params) { |
|
147 | 147 | return array_key_exists('param1', $params) |
148 | 148 | && array_key_exists('webapiKey', $params) |
149 | 149 | && $params['param1'] == 1337 |
@@ -2,11 +2,10 @@ |
||
2 | 2 | |
3 | 3 | namespace Radowoj\Yaah; |
4 | 4 | |
5 | -use PHPUnit\Framework\TestCase; |
|
6 | -use Radowoj\Yaah\Config; |
|
7 | -use Radowoj\Yaah\Client; |
|
8 | - |
|
9 | -use SoapClient; |
|
5 | +use PHPUnit\Framework\TestCase; |
|
6 | +use Radowoj\Yaah\Config; |
|
7 | +use Radowoj\Yaah\Client; |
|
8 | +use SoapClient; |
|
10 | 9 | use SoapFault; |
11 | 10 | |
12 | 11 | class ClientTest extends TestCase |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | protected function setRangeDate(array $range) |
203 | 203 | { |
204 | - usort($range, function($date1, $date2){ |
|
204 | + usort($range, function($date1, $date2) { |
|
205 | 205 | return strtotime($date1) - strtotime($date2); |
206 | 206 | }); |
207 | 207 | $this->fValues[self::VALUE_RANGE_DATE] = array_combine( |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | public function isRangeDate(array $range) |
244 | 244 | { |
245 | - $dates = array_filter($range, function($item){ |
|
245 | + $dates = array_filter($range, function($item) { |
|
246 | 246 | return preg_match(self::DATE_REGEX, $item); |
247 | 247 | }); |
248 | 248 |
@@ -11,6 +11,9 @@ |
||
11 | 11 | { |
12 | 12 | protected $config = null; |
13 | 13 | |
14 | + /** |
|
15 | + * @return \SoapClient |
|
16 | + */ |
|
14 | 17 | abstract protected function getSoapClient(); |
15 | 18 | |
16 | 19 | public function create(array $configArray) |
@@ -2,10 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Radowoj\Yaah\HelperFactory; |
4 | 4 | |
5 | -use Radowoj\Yaah\Config; |
|
6 | -use Radowoj\Yaah\Client; |
|
5 | +use Radowoj\Yaah\Config; |
|
6 | +use Radowoj\Yaah\Client; |
|
7 | 7 | use Radowoj\Yaah\Helper; |
8 | -use Radowoj\Yaah\Exception; |
|
9 | 8 | |
10 | 9 | abstract class HelperFactory |
11 | 10 | { |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Radowoj\Yaah\Journal; |
4 | 4 | |
5 | -use stdClass; |
|
5 | +use stdClass; |
|
6 | 6 | use InvalidArgumentException; |
7 | 7 | |
8 | 8 | /** |
@@ -72,7 +72,7 @@ |
||
72 | 72 | */ |
73 | 73 | protected function mapFromObject(stdClass $deal) |
74 | 74 | { |
75 | - foreach($deal as $prop => $value) { |
|
75 | + foreach ($deal as $prop => $value) { |
|
76 | 76 | $this->setProperty($prop, $value); |
77 | 77 | } |
78 | 78 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * Process journal entries - in this case echo details of every journal |
16 | 16 | * item that creates a deal |
17 | 17 | */ |
18 | - array_map(function($deal){ |
|
18 | + array_map(function($deal) { |
|
19 | 19 | if ($deal->isTypeCreateDeal()) { |
20 | 20 | echo "Deal {$deal->getId()} (itemId {$deal->getItemId()} - quantity {$deal->getQuantity()}) created at {$deal->getEventTime()}\n"; |
21 | 21 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | $items = $data->sellFormFieldsForCategory->sellFormFieldsList->item; |
31 | 31 | |
32 | - return array_map(function ($item) { |
|
32 | + return array_map(function($item) { |
|
33 | 33 | return [ |
34 | 34 | 'fid' => $item->sellFormId, |
35 | 35 | 'title' => $item->sellFormTitle, |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function finishAuctions(array $auctionIds, $cancelAllBids = 0, $finishCancelReason = '') |
89 | 89 | { |
90 | - $finishItemsList = array_map(function ($auctionId) use ($cancelAllBids, $finishCancelReason) { |
|
90 | + $finishItemsList = array_map(function($auctionId) use ($cancelAllBids, $finishCancelReason) { |
|
91 | 91 | return [ |
92 | 92 | 'finishItemId' => $auctionId, |
93 | 93 | 'finishCancelAllBids' => $cancelAllBids, |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $response = $this->client->doGetSiteJournalDeals(['journalStart' => $journalStart]); |
124 | 124 | if (isset($response->siteJournalDeals->item)) { |
125 | - return array_map(function($deal){ |
|
125 | + return array_map(function($deal) { |
|
126 | 126 | return new Deal($deal); |
127 | 127 | }, $response->siteJournalDeals->item); |
128 | 128 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function getAuctionByItemId($itemId) |
139 | 139 | { |
140 | - $response = $this->client->doGetItemFields(['itemId' => $itemId]); |
|
140 | + $response = $this->client->doGetItemFields(['itemId' => $itemId]); |
|
141 | 141 | if (!isset($response->itemFields->item)) { |
142 | 142 | throw new Exception('Invalid WebAPI response: ' . print_r($response, 1)); |
143 | 143 | } |