Skip to content

Commit 4668044

Browse files
committed
Fix typed properties used before initialization and return type for static[]
1 parent e1e88af commit 4668044

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

src/Connection/Connector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class Connector implements ConnectorInterface
2626
{
2727
protected array $config = [];
2828

29-
protected ?ClientInterface $client;
29+
protected ?ClientInterface $client = null;
3030

3131
protected $oauthMiddleware;
3232

33-
protected ?AbstractProvider $provider;
33+
protected ?AbstractProvider $provider = null;
3434

3535
protected SessionInterface $session;
3636

src/Model/ActivityLog/LogItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function singleFromJson(string $str): self|false
4646
* @return static[]
4747
*@deprecated use LogItem::multipleFromJsonStreamWithSeal() instead
4848
*/
49-
public static function multipleFromJsonStream(string $str): static
49+
public static function multipleFromJsonStream(string $str): array
5050
{
5151
$items = [];
5252
foreach (explode("\n", trim($str, "\n")) as $line) {

src/Model/ApiResourceBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class ApiResourceBase implements \ArrayAccess
3434

3535
protected bool $isFull = false;
3636

37-
protected ?Collection $parentCollection;
37+
protected ?Collection $parentCollection = null;
3838

3939
/**
4040
* @param array $data The raw data for the resource
@@ -230,7 +230,7 @@ public static function getRequired(): array
230230
*
231231
* @return static[]
232232
*/
233-
public static function getCollection(string $url, int $limit, array $options, ClientInterface $client): static
233+
public static function getCollection(string $url, int $limit, array $options, ClientInterface $client): array
234234
{
235235
$items = static::getCollectionWithParent($url, $client, $options)['items'];
236236

src/Model/Backups/RestoreOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
class RestoreOptions
88
{
9-
private ?string $environmentName;
9+
private ?string $environmentName = null;
1010

11-
private ?string $branchFrom;
11+
private ?string $branchFrom = null;
1212

1313
private ?bool $restoreCode;
1414

src/Model/BasicProjectInfo.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ class BasicProjectInfo
2121

2222
public string $title;
2323

24-
public ?string $region;
24+
public ?string $region = null;
2525

26-
public ?string $subscription_id;
26+
public ?string $subscription_id = null;
2727

28-
public ?OrganizationRef $organization_ref;
28+
public ?OrganizationRef $organization_ref = null;
2929

30-
public ?string $created_at;
30+
public ?string $created_at = null;
3131

32-
public ?string $status;
32+
public ?string $status = null;
3333

3434
public ?string $organization_id;
3535

src/Model/CentralizedPermissions/UserExtendedAccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class UserExtendedAccess extends ResourceWithReferences
2727
/**
2828
* @return static[]
2929
*/
30-
public static function byUser(string $userId, array $options, ClientInterface $client): static
30+
public static function byUser(string $userId, array $options, ClientInterface $client): array
3131
{
3232
return self::getCollection('/users/' . rawurlencode($userId) . '/extended-access', 0, $options, $client);
3333
}

src/Model/CentralizedPermissions/UserProjectAccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class UserProjectAccess extends ResourceWithReferences
2424
/**
2525
* @return static[]
2626
*/
27-
public static function byUser(string $userId, array $options, ClientInterface $client): static
27+
public static function byUser(string $userId, array $options, ClientInterface $client): array
2828
{
2929
return self::getCollection('/users/' . rawurlencode($userId) . '/project-access', 0, $options, $client);
3030
}

src/Model/Subscription/SubscriptionOptions.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77

88
final class SubscriptionOptions
99
{
10-
private ?string $project_region;
10+
private ?string $project_region = null;
1111

12-
private ?string $project_title;
12+
private ?string $project_title = null;
1313

14-
private ?string $default_branch;
14+
private ?string $default_branch = null;
1515

16-
private ?string $options_url;
16+
private ?string $options_url = null;
1717

18-
private ?array $options_custom;
18+
private ?array $options_custom = null;
1919

20-
private ?string $plan;
20+
private ?string $plan = null;
2121

22-
private ?int $environments;
22+
private ?int $environments = null;
2323

24-
private ?int $storage;
24+
private ?int $storage = null;
2525

26-
private ?string $owner;
26+
private ?string $owner = null;
2727

2828
/**
2929
* @deprecated This is no longer supported. Poll the subscription instead of submitting a callback.

src/PlatformClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class PlatformClient
3838
/**
3939
* @var array|null A per-client cache for account info
4040
*/
41-
protected ?array $accountInfo;
41+
protected ?array $accountInfo = null;
4242

4343
/**
4444
* @var string|false|null A per-client cache for the user ID

0 commit comments

Comments
 (0)