@@ -41,7 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | $requiredParams = ['apiKey', 'login', 'passwordHash', 'isSandbox', 'countryCode']; |
43 | 43 | |
44 | - foreach($requiredParams as $property) { |
|
44 | + foreach ($requiredParams as $property) { |
|
45 | 45 | if (!array_key_exists($property, $params)) { |
46 | 46 | throw new Exception("{$property} is required in params array"); |
47 | 47 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -use PHPUnit\Framework\TestCase; |
|
3 | +use PHPUnit\Framework\TestCase; |
|
4 | 4 | use Radowoj\Yaah\Field; |
5 | 5 | |
6 | 6 | class FieldTest extends TestCase |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @throws Radowoj\Yaah\Exception on failure |
41 | 41 | * |
42 | - * @param Radowoj\Yaah\Auction $auction Auction to create |
|
42 | + * @param Auction $auction Auction to create |
|
43 | 43 | * @param integer $localId - local item id, required by WebAPI |
44 | 44 | * @return integer id of created auction |
45 | 45 | */ |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | /** |
127 | 127 | * @param integer $itemId id of auction to get |
128 | - * @return Radowoj\Yaah\Auction | null |
|
128 | + * @return Auction|null | null |
|
129 | 129 | */ |
130 | 130 | public function getAuctionByItemId($itemId) |
131 | 131 | { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $data = $this->client->getSellFormFieldsForCategory(['categoryId' => $idCategory]); |
24 | 24 | $items = $data->sellFormFieldsForCategory->sellFormFieldsList->item; |
25 | 25 | |
26 | - return array_map(function ($item) { |
|
26 | + return array_map(function($item) { |
|
27 | 27 | return [ |
28 | 28 | 'fid' => $item->sellFormId, |
29 | 29 | 'title' => $item->sellFormTitle, |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function finishAuctions(array $auctionIds, $cancelAllBids = 0, $finishCancelReason = '') |
83 | 83 | { |
84 | - $finishItemsList = array_map(function ($auctionId) use ($cancelAllBids, $finishCancelReason) { |
|
84 | + $finishItemsList = array_map(function($auctionId) use ($cancelAllBids, $finishCancelReason) { |
|
85 | 85 | return [ |
86 | 86 | 'finishItemId' => $auctionId, |
87 | 87 | 'finishCancelAllBids' => $cancelAllBids, |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function getAuctionByItemId($itemId) |
131 | 131 | { |
132 | - $response = $this->client->getItemFields(['itemId' => $itemId]); |
|
132 | + $response = $this->client->getItemFields(['itemId' => $itemId]); |
|
133 | 133 | if (isset($response->itemFields->item)) { |
134 | 134 | $auction = new Auction(); |
135 | 135 | $auction->fromApiRepresentation($response->itemFields->item); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $fields = []; |
36 | 36 | |
37 | - foreach($this->fields as $fid => $value) { |
|
37 | + foreach ($this->fields as $fid => $value) { |
|
38 | 38 | $fields[] = (new Field($fid, $value))->toArray(); |
39 | 39 | } |
40 | 40 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->fields = []; |
52 | 52 | $this->photos = []; |
53 | 53 | |
54 | - foreach($fields as $apiField) { |
|
54 | + foreach ($fields as $apiField) { |
|
55 | 55 | $field = new Field(0, ''); |
56 | 56 | $field->fromArray((array)$apiField); |
57 | 57 | $this->fields[$field->getFid()] = $field->getValue(); |
@@ -149,7 +149,6 @@ discard block |
||
149 | 149 | |
150 | 150 | /** |
151 | 151 | * Detect type of range passed as argument (int, float, date) |
152 | - * @param array $value value to detect type |
|
153 | 152 | */ |
154 | 153 | protected function setValueRangeAutodetect(array $range) |
155 | 154 | { |
@@ -201,6 +200,9 @@ discard block |
||
201 | 200 | |
202 | 201 | |
203 | 202 | |
203 | + /** |
|
204 | + * @param string $forceValueType |
|
205 | + */ |
|
204 | 206 | protected function setValueForced($forceValueType, $value) |
205 | 207 | { |
206 | 208 | if (!property_exists($this, $forceValueType)) { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | ['fvalueRangeFloatMin', 'fvalueRangeFloatMax'], |
168 | 168 | $range |
169 | 169 | ); |
170 | - } elseif($this->isRangeInt($range)) { |
|
170 | + } elseif ($this->isRangeInt($range)) { |
|
171 | 171 | $this->fvalueRangeInt = array_combine( |
172 | 172 | ['fvalueRangeIntMin', 'fvalueRangeIntMax'], |
173 | 173 | $range |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | //recursive object to array :) |
241 | 241 | $array = json_decode(json_encode($array), true); |
242 | 242 | |
243 | - foreach($array as $key => $value) { |
|
243 | + foreach ($array as $key => $value) { |
|
244 | 244 | if (!property_exists($this, $key)) { |
245 | 245 | throw new Exception("Unknown Field property: {$key}"); |
246 | 246 | } |