@@ -109,13 +109,13 @@ class Matomo
109
109
public function __construct (
110
110
string $ site ,
111
111
string $ token ,
112
- int $ siteId = null ,
112
+ ? int $ siteId = null ,
113
113
string $ format = self ::FORMAT_JSON ,
114
114
string $ period = self ::PERIOD_DAY ,
115
115
string $ date = self ::DATE_YESTERDAY ,
116
116
string $ rangeStart = '' ,
117
- string $ rangeEnd = null ,
118
- ClientInterface $ client = null ,
117
+ ? string $ rangeEnd = null ,
118
+ ? ClientInterface $ client = null ,
119
119
) {
120
120
$ this ->_site = $ site ;
121
121
$ this ->_token = $ token ;
@@ -288,7 +288,7 @@ public function getDate(): string
288
288
*
289
289
* @return $this
290
290
*/
291
- public function setDate (string $ date = null ): Matomo
291
+ public function setDate (? string $ date = null ): Matomo
292
292
{
293
293
$ this ->_date = $ date ;
294
294
$ this ->_rangeStart = null ;
@@ -349,7 +349,7 @@ public function getRange(): string
349
349
*
350
350
* @return $this
351
351
*/
352
- public function setRange (string $ rangeStart = null , string $ rangeEnd = null ): Matomo
352
+ public function setRange (? string $ rangeStart = null , ? string $ rangeEnd = null ): Matomo
353
353
{
354
354
$ this ->_date = '' ;
355
355
$ this ->_rangeStart = $ rangeStart ;
@@ -465,7 +465,7 @@ private function _request(
465
465
string $ method ,
466
466
array $ params = [],
467
467
array $ optional = [],
468
- string $ overrideFormat = null
468
+ ? string $ overrideFormat = null
469
469
): mixed {
470
470
$ url = $ this ->_parseUrl ($ method , $ params + $ optional );
471
471
if ($ url === '' ) {
@@ -599,7 +599,7 @@ private function _isValidResponse(string $contents): bool|string
599
599
* @return mixed Either the parsed response body object (parsed from json) or the raw response object.
600
600
* @throws JsonException
601
601
*/
602
- private function _parseResponse (string $ contents , string $ overrideFormat = null ): mixed
602
+ private function _parseResponse (string $ contents , ? string $ overrideFormat = null ): mixed
603
603
{
604
604
$ format = $ overrideFormat ?? $ this ->_format ;
605
605
0 commit comments