Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump PHP version requirement to 7.4 #182

Merged
merged 2 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": ">=7.3",
"php": ">=7.4",
"ext-json": "*",
"psr/http-client": "^1.0",
"psr/http-client-implementation": "^1.0",
Expand All @@ -21,9 +21,9 @@
},
"require-dev": {
"nyholm/psr7": "^1.8.1",
"php-cs-fixer/shim": "^v3.40.0",
"phpstan/phpstan": "^1.10.46",
"phpstan/phpstan-phpunit": "^1.3.15",
"php-cs-fixer/shim": "^v3.64.0",
"phpstan/phpstan": "^1.12.0",
"phpstan/phpstan-phpunit": "^1.4.0",
"symfony/http-client": "^5.0|^6.2|^7.0",
"symfony/phpunit-bridge": "^5.3|^6.2|^7.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function createRequest(string $method, string $uri): RequestInterface
*
* @phpstan-param int<1, max> $maxDepth
*/
protected function createStream($value, int $flags = null, int $maxDepth = 512): StreamInterface
protected function createStream($value, ?int $flags = null, int $maxDepth = 512): StreamInterface
{
$flags = $flags ?? (JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION);

Expand Down
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class Config
private $applicationAuthKey;
private $userAuthKey;

public function __construct(string $applicationId, string $applicationAuthKey, string $userAuthKey = null)
public function __construct(string $applicationId, string $applicationAuthKey, ?string $userAuthKey = null)
{
$this->applicationId = $applicationId;
$this->applicationAuthKey = $applicationAuthKey;
Expand Down
4 changes: 2 additions & 2 deletions src/Devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getOne(string $id): array
* @param int $limit How many devices to return. Max is 300. Default is 300
* @param int $offset Result offset. Default is 0. Results are sorted by id
*/
public function getAll(int $limit = null, int $offset = null): array
public function getAll(?int $limit = null, ?int $offset = null): array
{
$query = ['app_id' => $this->client->getConfig()->getApplicationId()];

Expand Down Expand Up @@ -184,7 +184,7 @@ public function onFocus(string $id, array $data): array
* Only devices from that segment will make it into the export
* @param int $lastActiveSince An epoch to filter results to users active after this time
*/
public function csvExport(array $extraFields = [], string $segmentName = null, int $lastActiveSince = null): array
public function csvExport(array $extraFields = [], ?string $segmentName = null, ?int $lastActiveSince = null): array
{
$request = $this->createRequest('POST', "/players/csv_export?app_id={$this->client->getConfig()->getApplicationId()}");
$request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}");
Expand Down
2 changes: 1 addition & 1 deletion src/Dto/Segment/CreateSegment.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CreateSegment implements AbstractDto
* @param non-empty-string|null $name
* @param array<int, AbstractFilter>|null $filters
*/
public function __construct(string $name = null, array $filters = null)
public function __construct(?string $name = null, ?array $filters = null)
{
$this->name = $name;
$this->filters = $filters;
Expand Down
2 changes: 1 addition & 1 deletion src/Dto/Segment/ListSegments.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ListSegments implements AbstractDto
* @param int<0, 2147483648>|null $limit
* @param int<0, 2147483648>|null $offset
*/
public function __construct(int $limit = null, int $offset = null)
public function __construct(?int $limit = null, ?int $offset = null)
{
$this->limit = $limit;
$this->offset = $offset;
Expand Down
6 changes: 3 additions & 3 deletions src/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public function getOne(string $id): array
*
* Application authentication key and ID must be set.
*
* @param int $limit How many notifications to return (max 50)
* @param int $offset Results offset (results are sorted by ID)
* @param int|null $limit How many notifications to return (max 50)
* @param int|null $offset Results offset (results are sorted by ID)
*
* @phpstan-param int $kind Kind of notifications returned. Default (not set) is all notification types
*/
public function getAll(int $limit = null, int $offset = null/* , int $kind = null */): array
public function getAll(?int $limit = null, ?int $offset = null/* , ?int $kind = null */): array
{
if (func_num_args() > 2 && !is_int(func_get_arg(2))) {
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__);
Expand Down
Loading