Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 907186e

Browse files
authored
Merge pull request #61 from keithbrink/analysis-QMQ223
Apply fixes from StyleCI
2 parents 91092ab + ab701a3 commit 907186e

File tree

70 files changed

+1375
-1227
lines changed

Some content is hidden

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

70 files changed

+1375
-1227
lines changed

src/AmazonCore.php

Lines changed: 75 additions & 68 deletions
Large diffs are not rendered by default.

src/AmazonFeed.php

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ class AmazonFeed extends AmazonFeedsCore
3939
* The parameters are passed to the parent constructor, which are
4040
* in turn passed to the AmazonCore constructor. See it for more information
4141
* on these parameters and common methods.
42-
* @param string $s <p>Name for the store you want to use.</p>
43-
* @param bool $mock [optional] <p>This is a flag for enabling Mock Mode.
44-
* This defaults to <b>FALSE</b>.</p>
45-
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
46-
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
42+
*
43+
* @param string $s <p>Name for the store you want to use.</p>
44+
* @param bool $mock [optional] <p>This is a flag for enabling Mock Mode.
45+
* This defaults to <b>FALSE</b>.</p>
46+
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
47+
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
4748
*/
4849
public function __construct($s, $mock = false, $m = null, $config = null)
4950
{
@@ -67,8 +68,8 @@ public function __construct($s, $mock = false, $m = null, $config = null)
6768
* Thie method sets the feed's contents from direct input.
6869
* This parameter is required in order to submit a feed to Amazon.
6970
*
70-
* @param string $s <p>The contents to put in the file.</p>
71-
* It can be relative or absolute.</p>
71+
* @param string $s <p>The contents to put in the file.</p>
72+
* It can be relative or absolute.</p>
7273
* @return bool <b>FALSE</b> if improper input
7374
*/
7475
public function setFeedContent($s)
@@ -87,8 +88,8 @@ public function setFeedContent($s)
8788
* This method loads the contents of a file to send as the feed. This
8889
* parameter is required in order to submit a feed to Amazon.
8990
*
90-
* @param string $url <p>The path to a file you want to use.
91-
* It can be relative or absolute.</p>
91+
* @param string $url <p>The path to a file you want to use.
92+
* It can be relative or absolute.</p>
9293
*/
9394
public function loadFeedFile($path)
9495
{
@@ -110,8 +111,8 @@ public function loadFeedFile($path)
110111
* Amazon how the Feed should be processsed.
111112
* This parameter is required in order to submit a feed to Amazon.
112113
*
113-
* @param string $s <p>A value from the list of valid Feed Types.
114-
* See the comment inside the function for the complete list.</p>
114+
* @param string $s <p>A value from the list of valid Feed Types.
115+
* See the comment inside the function for the complete list.</p>
115116
* @return bool <b>FALSE</b> if improper input
116117
*/
117118
public function setFeedType($s)
@@ -169,7 +170,7 @@ public function setFeedType($s)
169170
* to sell in. If this is not set, Amazon will only use the first Marketplace
170171
* you are registered for.
171172
*
172-
* @param array|string $s <p>A list of Marketplace IDs, or a single ID string.</p>
173+
* @param array|string $s <p>A list of Marketplace IDs, or a single ID string.</p>
173174
* @return bool <b>FALSE</b> if improper input
174175
*/
175176
public function setMarketplaceIds($s)
@@ -215,8 +216,9 @@ public function resetMarketplaceIds()
215216
* This method sets whether or not the tab delimited feed you provide should
216217
* completely replace old data. Use this parameter only in exceptional cases.
217218
* If this is not set, Amazon assumes it to be false.
218-
* @param bool|string $s [optional] <p>The value "true" or "false", either as
219-
* a boolean or a string. It defaults to "true".</p>
219+
*
220+
* @param bool|string $s [optional] <p>The value "true" or "false", either as
221+
* a boolean or a string. It defaults to "true".</p>
220222
* @return bool <b>FALSE</b> if improper input
221223
*/
222224
public function setPurge($s = 'true')
@@ -246,6 +248,7 @@ public function setPurge($s = 'true')
246248
* the feed's contents and feed type are required. The request will not be
247249
* sent if either of these are not set. Amazon will send a response back,
248250
* which can be retrieved using <i>getResponse</i>.
251+
*
249252
* @return bool <b>FALSE</b> if something goes wrong
250253
*/
251254
public function submitFeed()
@@ -293,7 +296,7 @@ public function submitFeed()
293296
*
294297
* This is what reads the response XML and converts it into an array.
295298
*
296-
* @param SimpleXMLObject $xml <p>The XML response from Amazon.</p>
299+
* @param SimpleXMLObject $xml <p>The XML response from Amazon.</p>
297300
* @return bool <b>FALSE</b> if no XML data is found
298301
*/
299302
protected function parseXML($xml)
@@ -333,8 +336,8 @@ protected function genHeader()
333336
* is different than the ones used by other objects due to Amazon sending
334337
* 100 Continue responses in addition to the usual response.
335338
*
336-
* @param array $r <p>The HTTP response array. Expects the array to have
337-
* the fields <i>code</i>, <i>body</i>, and <i>error</i>.</p>
339+
* @param array $r <p>The HTTP response array. Expects the array to have
340+
* the fields <i>code</i>, <i>body</i>, and <i>error</i>.</p>
338341
* @return bool <b>TRUE</b> if the status is 200 OK, <b>FALSE</b> otherwise.
339342
*/
340343
protected function checkResponse($r)

src/AmazonFeedList.php

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ class AmazonFeedList extends AmazonFeedsCore implements Iterator
4545
* The parameters are passed to the parent constructor, which are
4646
* in turn passed to the AmazonCore constructor. See it for more information
4747
* on these parameters and common methods.
48-
* @param string $s <p>Name for the store you want to use.</p>
49-
* @param bool $mock [optional] <p>This is a flag for enabling Mock Mode.
50-
* This defaults to <b>FALSE</b>.</p>
51-
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
52-
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
48+
*
49+
* @param string $s <p>Name for the store you want to use.</p>
50+
* @param bool $mock [optional] <p>This is a flag for enabling Mock Mode.
51+
* This defaults to <b>FALSE</b>.</p>
52+
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
53+
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
5354
*/
5455
public function __construct($s, $mock = false, $m = null, $config = null)
5556
{
@@ -66,6 +67,7 @@ public function __construct($s, $mock = false, $m = null, $config = null)
6667

6768
/**
6869
* Returns whether or not a token is available.
70+
*
6971
* @return bool
7072
*/
7173
public function hasToken()
@@ -80,7 +82,8 @@ public function hasToken()
8082
* the necessary operations to retrieve the rest of the list using tokens. If
8183
* this option is off, the object will only ever retrieve the first section of
8284
* the list.
83-
* @param bool $b [optional] <p>Defaults to <b>TRUE</b></p>
85+
*
86+
* @param bool $b [optional] <p>Defaults to <b>TRUE</b></p>
8487
* @return bool <b>FALSE</b> if improper input
8588
*/
8689
public function setUseToken($b = true)
@@ -99,7 +102,7 @@ public function setUseToken($b = true)
99102
* Setting this parameter tells Amazon to only return Feed Submissions that match
100103
* the IDs in the list. If this parameter is set, all other parameters will be ignored.
101104
*
102-
* @param array|string $s <p>A list of Feed Submission IDs, or a single ID string.</p>
105+
* @param array|string $s <p>A list of Feed Submission IDs, or a single ID string.</p>
103106
* @return bool <b>FALSE</b> if improper input
104107
*/
105108
public function setFeedIds($s)
@@ -142,7 +145,7 @@ public function resetFeedIds()
142145
* the types in the list. If this parameter is not set, Amazon will return
143146
* Feed Submissions of any type.
144147
*
145-
* @param array|string $s <p>A list of Feed Types, or a single type string.</p>
148+
* @param array|string $s <p>A list of Feed Types, or a single type string.</p>
146149
* @return bool <b>FALSE</b> if improper input
147150
*/
148151
public function setFeedTypes($s)
@@ -185,8 +188,8 @@ public function resetFeedTypes()
185188
* the statuses in the list. If this parameter is not set, Amazon will return
186189
* Feed Submissions with any status.
187190
*
188-
* @param array|string $s <p>A list of Feed Statuses, or a single status string.<br />
189-
* Valid values are "_SUBMITTED_", "_IN_PROGRESS_", "_CANCELLED_", and "_DONE_".</p>
191+
* @param array|string $s <p>A list of Feed Statuses, or a single status string.<br />
192+
* Valid values are "_SUBMITTED_", "_IN_PROGRESS_", "_CANCELLED_", and "_DONE_".</p>
190193
* @return bool <b>FALSE</b> if improper input
191194
*/
192195
public function setFeedStatuses($s)
@@ -227,7 +230,7 @@ public function resetFeedStatuses()
227230
* This method sets the maximum number of Feed Submissions for Amazon to return.
228231
* If this parameter is not set, Amazon will only send ten.
229232
*
230-
* @param array|string $s <p>Positive integer from 1 to 100.</p>
233+
* @param array|string $s <p>Positive integer from 1 to 100.</p>
231234
* @return bool <b>FALSE</b> if improper input
232235
*/
233236
public function setMaxCount($s)
@@ -248,8 +251,8 @@ public function setMaxCount($s)
248251
* only return Feed Submissions that were submitted within the past 180 days.
249252
* The parameters are passed through <i>strtotime</i>, so values such as "-1 hour" are fine.
250253
*
251-
* @param string $s [optional] <p>A time string for the earliest time.</p>
252-
* @param string $e [optional] <p>A time string for the latest time.</p>
254+
* @param string $s [optional] <p>A time string for the earliest time.</p>
255+
* @param string $e [optional] <p>A time string for the latest time.</p>
253256
*/
254257
public function setTimeLimits($s = null, $e = null)
255258
{
@@ -282,6 +285,7 @@ public function resetTimeLimits()
282285
* the list back as a response, which can be retrieved using <i>getFeedList</i>.
283286
* Other methods are available for fetching specific values from the list.
284287
* This operation can potentially involve tokens.
288+
*
285289
* @param bool <p>When set to <b>FALSE</b>, the function will not recurse, defaults to <b>TRUE</b></p>
286290
* @return bool <b>FALSE</b> if something goes wrong
287291
*/
@@ -363,7 +367,7 @@ protected function prepareToken()
363367
*
364368
* This is what reads the response XML and converts it into an array.
365369
*
366-
* @param SimpleXMLObject $xml <p>The XML response from Amazon.</p>
370+
* @param SimpleXMLObject $xml <p>The XML response from Amazon.</p>
367371
* @return bool <b>FALSE</b> if no XML data is found
368372
*/
369373
protected function parseXML($xml)
@@ -395,6 +399,7 @@ protected function parseXML($xml)
395399
*
396400
* Submits a <i>GetFeedSubmissionCount</i> request to Amazon. Amazon will send
397401
* the number back as a response, which can be retrieved using <i>getCount</i>.
402+
*
398403
* @return bool <b>FALSE</b> if something goes wrong
399404
*/
400405
public function countFeeds()
@@ -453,6 +458,7 @@ protected function prepareCount()
453458
* as a response the list of feeds that were cancelled, along with the count
454459
* of the number of affected feeds. This data can be retrieved using the same
455460
* methods as with <i>fetchFeedSubmissions</i> and <i>countFeeds</i>.
461+
*
456462
* @return bool <b>FALSE</b> if something goes wrong
457463
*/
458464
public function cancelFeeds()
@@ -508,7 +514,7 @@ protected function prepareCancel()
508514
*
509515
* This method will return <b>FALSE</b> if the list has not yet been filled.
510516
*
511-
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
517+
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
512518
* @return string|bool single value, or <b>FALSE</b> if Non-numeric index
513519
*/
514520
public function getFeedId($i = 0)
@@ -525,7 +531,7 @@ public function getFeedId($i = 0)
525531
*
526532
* This method will return <b>FALSE</b> if the list has not yet been filled.
527533
*
528-
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
534+
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
529535
* @return string|bool single value, or <b>FALSE</b> if Non-numeric index
530536
*/
531537
public function getFeedType($i = 0)
@@ -543,7 +549,7 @@ public function getFeedType($i = 0)
543549
* This method will return <b>FALSE</b> if the list has not yet been filled.
544550
* The time will be in the ISO8601 date format.
545551
*
546-
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
552+
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
547553
* @return string|bool single value, or <b>FALSE</b> if Non-numeric index
548554
*/
549555
public function getDateSubmitted($i = 0)
@@ -561,7 +567,7 @@ public function getDateSubmitted($i = 0)
561567
* This method will return <b>FALSE</b> if the list has not yet been filled.
562568
* See <i>setFeedStatuses</i> for a list of possible values.
563569
*
564-
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
570+
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
565571
* @return string|bool single value, or <b>FALSE</b> if Non-numeric index
566572
*/
567573
public function getFeedStatus($i = 0)
@@ -585,7 +591,7 @@ public function getFeedStatus($i = 0)
585591
* <li><b>FeedProcessingStatus</b> - see <i>setFeedStatuses</i> for a list of possible values</li>
586592
* </ul>
587593
*
588-
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
594+
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to 0.</p>
589595
* @return array|bool array of values, or <b>FALSE</b> if Non-numeric index
590596
*/
591597
public function getFeedInfo($i = 0)
@@ -601,6 +607,7 @@ public function getFeedInfo($i = 0)
601607
* Returns the full list.
602608
*
603609
* This method will return <b>FALSE</b> if the list has not yet been filled.
610+
*
604611
* @return array|bool multi-dimensional array, or <b>FALSE</b> if list not filled yet
605612
*/
606613
public function getFeedList()
@@ -616,6 +623,7 @@ public function getFeedList()
616623
* Returns the feed count from either countFeeds or cancelFeeds.
617624
*
618625
* This method will return <b>FALSE</b> if the count has not been set yet.
626+
*
619627
* @return number|bool number, or <b>FALSE</b> if count not set yet
620628
*/
621629
public function getFeedCount()
@@ -629,6 +637,7 @@ public function getFeedCount()
629637

630638
/**
631639
* Iterator function.
640+
*
632641
* @return type
633642
*/
634643
public function current()
@@ -646,6 +655,7 @@ public function rewind()
646655

647656
/**
648657
* Iterator function.
658+
*
649659
* @return type
650660
*/
651661
public function key()
@@ -663,6 +673,7 @@ public function next()
663673

664674
/**
665675
* Iterator function.
676+
*
666677
* @return type
667678
*/
668679
public function valid()

src/AmazonFeedResult.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ class AmazonFeedResult extends AmazonFeedsCore
4040
* on these parameters and common methods.
4141
* Please note that an extra parameter comes before the usual Mock Mode parameters,
4242
* so be careful when setting up the object.
43-
* @param string $s <p>Name for the store you want to use.</p>
44-
* @param string $id [optional] <p>The Feed Submission ID to set for the object.</p>
45-
* @param bool $mock [optional] <p>This is a flag for enabling Mock Mode.
46-
* This defaults to <b>FALSE</b>.</p>
47-
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
48-
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
43+
*
44+
* @param string $s <p>Name for the store you want to use.</p>
45+
* @param string $id [optional] <p>The Feed Submission ID to set for the object.</p>
46+
* @param bool $mock [optional] <p>This is a flag for enabling Mock Mode.
47+
* This defaults to <b>FALSE</b>.</p>
48+
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
49+
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
4950
*/
5051
public function __construct($s, $id = null, $mock = false, $m = null, $config = null)
5152
{
@@ -72,7 +73,8 @@ public function __construct($s, $id = null, $mock = false, $m = null, $config =
7273
*
7374
* This method sets the feed submission ID to be sent in the next request. This
7475
* parameter is required in order to retrieve a feed from Amazon.
75-
* @param string|int $n <p>Must be numeric</p>
76+
*
77+
* @param string|int $n <p>Must be numeric</p>
7678
* @return bool <b>FALSE</b> if improper input
7779
*/
7880
public function setFeedId($n)
@@ -90,6 +92,7 @@ public function setFeedId($n)
9092
* Submits a <i>GetFeedSubmissionResult</i> request to Amazon. In order to
9193
* do this, a feed submission ID is required. Amazon will send back the raw results
9294
* of the feed as a response, which can be saved to a file using <i>saveFeed</i>.
95+
*
9396
* @return bool <b>FALSE</b> if something goes wrong
9497
*/
9598
public function fetchFeedResult()
@@ -122,7 +125,7 @@ public function fetchFeedResult()
122125
*
123126
* This method will record in the log whether or not the save was successful.
124127
*
125-
* @param string $path <p>path for the file to save the feed data in</p>
128+
* @param string $path <p>path for the file to save the feed data in</p>
126129
* @return bool <b>FALSE</b> if something goes wrong
127130
*/
128131
public function saveFeed($path)
@@ -148,6 +151,7 @@ public function saveFeed($path)
148151
* Returns the entire raw report data.
149152
*
150153
* This is useful for handling the report with an external file management system.
154+
*
151155
* @return string|bool The raw report data as a string, or <b>FALSE</b> if there is no data
152156
*/
153157
public function getRawFeed()

src/AmazonFeedsCore.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ abstract class AmazonFeedsCore extends AmazonCore
3535
* in turn passed to the AmazonCore constructor. See it for more information
3636
* on these parameters and common methods.
3737
*
38-
* @param string $s <p>Name for the store you want to use.</p>
39-
* @param bool $mock [optional] <p>This is a flag for enabling Mock Mode.
40-
* This defaults to <b>FALSE</b>.</p>
41-
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
42-
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
38+
* @param string $s <p>Name for the store you want to use.</p>
39+
* @param bool $mock [optional] <p>This is a flag for enabling Mock Mode.
40+
* This defaults to <b>FALSE</b>.</p>
41+
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
42+
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
4343
*/
4444
public function __construct($s, $mock = false, $m = null, $config = null)
4545
{

0 commit comments

Comments
 (0)