1 | <?php |
||
13 | class Report extends PagedLazyResourceList implements \Iterator, \Countable |
||
14 | { |
||
15 | /** @var Client */ |
||
16 | protected $client; |
||
17 | |||
18 | /** @var string */ |
||
19 | public $path; |
||
20 | |||
21 | /** @var string */ |
||
22 | public $filter; |
||
23 | |||
24 | /** @var array */ |
||
25 | protected $headers = []; |
||
26 | |||
27 | /** @var string */ |
||
28 | protected $resumptionToken = null; |
||
29 | |||
30 | /** @var boolean */ |
||
31 | protected $isFinished = false; |
||
32 | |||
33 | /** @var integer */ |
||
34 | public $chunkSize = 1000; |
||
35 | |||
36 | public static $maxAttempts = 5; |
||
37 | |||
38 | public static $retryDelayTime = 3; |
||
39 | |||
40 | public function __construct(Client $client = null, $path = null, $headers = [], $filter = null) |
||
48 | |||
49 | /** |
||
50 | * @deprecated |
||
51 | * @return $this |
||
52 | */ |
||
53 | public function getRows() |
||
57 | |||
58 | |||
59 | public function getHeaders() |
||
67 | |||
68 | /** |
||
69 | * Generate the base URL for this resource. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | protected function urlBase() |
||
77 | |||
78 | /** |
||
79 | * Convert a retrieved resource to an object. |
||
80 | * |
||
81 | * @param $data |
||
82 | * @return mixed |
||
83 | */ |
||
84 | protected function convertToResource($data) |
||
88 | |||
89 | /** |
||
90 | * Note: chunkSize must be between 25 and 1000. |
||
91 | * |
||
92 | * @param int $attempt |
||
93 | * @param int $chunkSize |
||
94 | * @return void |
||
95 | */ |
||
96 | protected function fetchBatch($attempt = 1, $chunkSize = null) |
||
143 | |||
144 | /** |
||
145 | * Read column headers from response, and check that we got the right number of columns back. |
||
146 | * |
||
147 | * @param QuiteSimpleXMLElement $results |
||
148 | */ |
||
149 | protected function readColumnHeaders(QuiteSimpleXMLElement $results) |
||
175 | |||
176 | /** |
||
177 | * Check if we have the full representation of our data object. We cannot |
||
178 | * really know from the data object alone, but when this method is called |
||
179 | * we should have all the data. |
||
180 | * |
||
181 | * @param \stdClass $data |
||
182 | * @return boolean |
||
183 | */ |
||
184 | protected function isInitialized($data) |
||
188 | |||
189 | /** |
||
190 | * Total number of resources. Note that we don't get this number from API upfront, |
||
191 | * so we have to fetch all the rows to find out. |
||
192 | * |
||
193 | * @link http://php.net/manual/en/countable.count.php |
||
194 | * @return int |
||
195 | */ |
||
196 | public function count() |
||
200 | |||
201 | /** |
||
202 | * Magic! |
||
203 | * @param string $key |
||
204 | * @return mixed |
||
205 | */ |
||
206 | public function __get($key) |
||
215 | } |
||
216 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):