@@ -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 | } |
@@ -7,6 +7,9 @@ |
||
7 | 7 | |
8 | 8 | class DealTest extends TestCase |
9 | 9 | { |
10 | + /** |
|
11 | + * @return \stdClass |
|
12 | + */ |
|
10 | 13 | protected function getExampleDeal() |
11 | 14 | { |
12 | 15 | return (object)[ |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Radowoj\Yaah\Journal; |
4 | 4 | |
5 | 5 | use PHPUnit\Framework\TestCase; |
6 | -use Radowoj\Yaah\Auction; |
|
7 | 6 | |
8 | 7 | class DealTest extends TestCase |
9 | 8 | { |
@@ -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 | $auction = new Auction(); |
143 | 143 | $auction->fromApiRepresentation($response->itemFields->item); |
@@ -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 | } |