Skip to content

Commit 17f3756

Browse files
authored
Bump PHP version requirement to 7.4 (#182)
* Bump PHP version requirement to 7.4 * Fix CS
1 parent af80fa0 commit 17f3756

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.3",
13+
"php": ">=7.4",
1414
"ext-json": "*",
1515
"psr/http-client": "^1.0",
1616
"psr/http-client-implementation": "^1.0",
@@ -21,9 +21,9 @@
2121
},
2222
"require-dev": {
2323
"nyholm/psr7": "^1.8.1",
24-
"php-cs-fixer/shim": "^v3.40.0",
25-
"phpstan/phpstan": "^1.10.46",
26-
"phpstan/phpstan-phpunit": "^1.3.15",
24+
"php-cs-fixer/shim": "^v3.64.0",
25+
"phpstan/phpstan": "^1.12.0",
26+
"phpstan/phpstan-phpunit": "^1.4.0",
2727
"symfony/http-client": "^5.0|^6.2|^7.0",
2828
"symfony/phpunit-bridge": "^5.3|^6.2|^7.0"
2929
},

src/AbstractApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function createRequest(string $method, string $uri): RequestInterface
3636
*
3737
* @phpstan-param int<1, max> $maxDepth
3838
*/
39-
protected function createStream($value, int $flags = null, int $maxDepth = 512): StreamInterface
39+
protected function createStream($value, ?int $flags = null, int $maxDepth = 512): StreamInterface
4040
{
4141
$flags = $flags ?? (JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION);
4242

src/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class Config
1010
private $applicationAuthKey;
1111
private $userAuthKey;
1212

13-
public function __construct(string $applicationId, string $applicationAuthKey, string $userAuthKey = null)
13+
public function __construct(string $applicationId, string $applicationAuthKey, ?string $userAuthKey = null)
1414
{
1515
$this->applicationId = $applicationId;
1616
$this->applicationAuthKey = $applicationAuthKey;

src/Devices.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getOne(string $id): array
5353
* @param int $limit How many devices to return. Max is 300. Default is 300
5454
* @param int $offset Result offset. Default is 0. Results are sorted by id
5555
*/
56-
public function getAll(int $limit = null, int $offset = null): array
56+
public function getAll(?int $limit = null, ?int $offset = null): array
5757
{
5858
$query = ['app_id' => $this->client->getConfig()->getApplicationId()];
5959

@@ -184,7 +184,7 @@ public function onFocus(string $id, array $data): array
184184
* Only devices from that segment will make it into the export
185185
* @param int $lastActiveSince An epoch to filter results to users active after this time
186186
*/
187-
public function csvExport(array $extraFields = [], string $segmentName = null, int $lastActiveSince = null): array
187+
public function csvExport(array $extraFields = [], ?string $segmentName = null, ?int $lastActiveSince = null): array
188188
{
189189
$request = $this->createRequest('POST', "/players/csv_export?app_id={$this->client->getConfig()->getApplicationId()}");
190190
$request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}");

src/Dto/Segment/CreateSegment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CreateSegment implements AbstractDto
2323
* @param non-empty-string|null $name
2424
* @param array<int, AbstractFilter>|null $filters
2525
*/
26-
public function __construct(string $name = null, array $filters = null)
26+
public function __construct(?string $name = null, ?array $filters = null)
2727
{
2828
$this->name = $name;
2929
$this->filters = $filters;

src/Dto/Segment/ListSegments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ListSegments implements AbstractDto
2222
* @param int<0, 2147483648>|null $limit
2323
* @param int<0, 2147483648>|null $offset
2424
*/
25-
public function __construct(int $limit = null, int $offset = null)
25+
public function __construct(?int $limit = null, ?int $offset = null)
2626
{
2727
$this->limit = $limit;
2828
$this->offset = $offset;

src/Notifications.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public function getOne(string $id): array
4040
*
4141
* Application authentication key and ID must be set.
4242
*
43-
* @param int $limit How many notifications to return (max 50)
44-
* @param int $offset Results offset (results are sorted by ID)
43+
* @param int|null $limit How many notifications to return (max 50)
44+
* @param int|null $offset Results offset (results are sorted by ID)
4545
*
4646
* @phpstan-param int $kind Kind of notifications returned. Default (not set) is all notification types
4747
*/
48-
public function getAll(int $limit = null, int $offset = null/* , int $kind = null */): array
48+
public function getAll(?int $limit = null, ?int $offset = null/* , ?int $kind = null */): array
4949
{
5050
if (func_num_args() > 2 && !is_int(func_get_arg(2))) {
5151
trigger_deprecation('norkunas/onesignal-php-api', '2.1.0', 'Method %s() will have a third `int $kind` argument. Not defining it or passing a non integer value is deprecated.', __METHOD__);

0 commit comments

Comments
 (0)