Skip to content

Commit

Permalink
Fix typed properties used before initialization and return type for s…
Browse files Browse the repository at this point in the history
…tatic[]
  • Loading branch information
pjcdawkins committed Nov 25, 2024
1 parent e1e88af commit 4668044
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/Connection/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class Connector implements ConnectorInterface
{
protected array $config = [];

protected ?ClientInterface $client;
protected ?ClientInterface $client = null;

protected $oauthMiddleware;

protected ?AbstractProvider $provider;
protected ?AbstractProvider $provider = null;

protected SessionInterface $session;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/ActivityLog/LogItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function singleFromJson(string $str): self|false
* @return static[]
*@deprecated use LogItem::multipleFromJsonStreamWithSeal() instead
*/
public static function multipleFromJsonStream(string $str): static
public static function multipleFromJsonStream(string $str): array
{
$items = [];
foreach (explode("\n", trim($str, "\n")) as $line) {
Expand Down
4 changes: 2 additions & 2 deletions src/Model/ApiResourceBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class ApiResourceBase implements \ArrayAccess

protected bool $isFull = false;

protected ?Collection $parentCollection;
protected ?Collection $parentCollection = null;

/**
* @param array $data The raw data for the resource
Expand Down Expand Up @@ -230,7 +230,7 @@ public static function getRequired(): array
*
* @return static[]
*/
public static function getCollection(string $url, int $limit, array $options, ClientInterface $client): static
public static function getCollection(string $url, int $limit, array $options, ClientInterface $client): array
{
$items = static::getCollectionWithParent($url, $client, $options)['items'];

Expand Down
4 changes: 2 additions & 2 deletions src/Model/Backups/RestoreOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

class RestoreOptions
{
private ?string $environmentName;
private ?string $environmentName = null;

private ?string $branchFrom;
private ?string $branchFrom = null;

private ?bool $restoreCode;

Expand Down
10 changes: 5 additions & 5 deletions src/Model/BasicProjectInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class BasicProjectInfo

public string $title;

public ?string $region;
public ?string $region = null;

public ?string $subscription_id;
public ?string $subscription_id = null;

public ?OrganizationRef $organization_ref;
public ?OrganizationRef $organization_ref = null;

public ?string $created_at;
public ?string $created_at = null;

public ?string $status;
public ?string $status = null;

public ?string $organization_id;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/CentralizedPermissions/UserExtendedAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class UserExtendedAccess extends ResourceWithReferences
/**
* @return static[]
*/
public static function byUser(string $userId, array $options, ClientInterface $client): static
public static function byUser(string $userId, array $options, ClientInterface $client): array
{
return self::getCollection('/users/' . rawurlencode($userId) . '/extended-access', 0, $options, $client);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Model/CentralizedPermissions/UserProjectAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UserProjectAccess extends ResourceWithReferences
/**
* @return static[]
*/
public static function byUser(string $userId, array $options, ClientInterface $client): static
public static function byUser(string $userId, array $options, ClientInterface $client): array
{
return self::getCollection('/users/' . rawurlencode($userId) . '/project-access', 0, $options, $client);
}
Expand Down
18 changes: 9 additions & 9 deletions src/Model/Subscription/SubscriptionOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

final class SubscriptionOptions
{
private ?string $project_region;
private ?string $project_region = null;

private ?string $project_title;
private ?string $project_title = null;

private ?string $default_branch;
private ?string $default_branch = null;

private ?string $options_url;
private ?string $options_url = null;

private ?array $options_custom;
private ?array $options_custom = null;

private ?string $plan;
private ?string $plan = null;

private ?int $environments;
private ?int $environments = null;

private ?int $storage;
private ?int $storage = null;

private ?string $owner;
private ?string $owner = null;

/**
* @deprecated This is no longer supported. Poll the subscription instead of submitting a callback.
Expand Down
2 changes: 1 addition & 1 deletion src/PlatformClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PlatformClient
/**
* @var array|null A per-client cache for account info
*/
protected ?array $accountInfo;
protected ?array $accountInfo = null;

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

0 comments on commit 4668044

Please sign in to comment.