Skip to content

Commit

Permalink
Add PHP CS Fixer rule to ensure blank lines between class attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed Dec 19, 2024
1 parent 4a9bd2e commit 538f35b
Show file tree
Hide file tree
Showing 67 changed files with 149 additions and 5 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
->setRiskyAllowed(true)
->setRules([
'@PER-CS2.0' => true,
'class_attributes_separation' => true,
'class_definition' => [
'single_line' => true,
],
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
],
"analyze": "@analyse",
"cs": [
"vendor/bin/php-cs-fixer fix --diff --verbose"
"PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --diff --verbose"
],
"docs": [
"cd docs && make html"
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/AppCheck/AppCheckTokenGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
final class AppCheckTokenGenerator
{
private const APP_CHECK_AUDIENCE = 'https://firebaseappcheck.googleapis.com/google.firebase.appcheck.v1.TokenExchangeService';

private readonly ClockInterface $clock;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
final class ValidatedActionCodeSettings implements ActionCodeSettings
{
private ?UriInterface $continueUrl = null;

private ?bool $canHandleCodeInApp = null;

private ?UriInterface $dynamicLinkDomain = null;

/**
Expand All @@ -29,6 +31,7 @@ final class ValidatedActionCodeSettings implements ActionCodeSettings
* @var non-empty-string|null
*/
private ?string $androidMinimumVersion = null;

private ?bool $androidInstallApp = null;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Firebase/Auth/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
class ApiClient
{
private readonly ProjectAwareAuthResourceUrlBuilder|TenantAwareAuthResourceUrlBuilder $awareAuthResourceUrlBuilder;

private readonly AuthResourceUrlBuilder $authResourceUrlBuilder;

private readonly AuthApiExceptionConverter $errorHandler;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Firebase/Auth/AuthResourceUrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
final class AuthResourceUrlBuilder
{
private const URL_FORMAT = 'https://identitytoolkit.googleapis.com/{version}{api}';

private const EMULATOR_URL_FORMAT = 'http://{host}/identitytoolkit.googleapis.com/{version}{api}';

private const DEFAULT_API_VERSION = 'v1';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
final class FailedToCreateActionLink extends RuntimeException implements AuthException
{
private ?CreateActionLink $action = null;

private ?ResponseInterface $response = null;

public static function withActionAndResponse(CreateActionLink $action, ResponseInterface $response): self
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Auth/CreateSessionCookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
final class CreateSessionCookie
{
private const FIVE_MINUTES = 'PT5M';

private const TWO_WEEKS = 'P14D';

private function __construct(
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Auth/CustomTokenViaGoogleCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
final class CustomTokenViaGoogleCredentials
{
private readonly JoseEncoder $encoder;

private readonly Parser $parser;

public function __construct(private readonly SignBlobInterface $signer, private readonly ?string $tenantId = null)
Expand Down
2 changes: 2 additions & 0 deletions src/Firebase/Auth/ProjectAwareAuthResourceUrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
final class ProjectAwareAuthResourceUrlBuilder
{
private const URL_FORMAT = 'https://identitytoolkit.googleapis.com/{version}/projects/{projectId}{api}';

private const EMULATOR_URL_FORMAT = 'http://{host}/identitytoolkit.googleapis.com/{version}/projects/{projectId}{api}';

private const DEFAULT_API_VERSION = 'v1';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
final class FailedToSendActionLink extends RuntimeException implements AuthException
{
private ?SendActionLink $action = null;

private ?ResponseInterface $response = null;

public static function withActionAndResponse(SendActionLink $action, ResponseInterface $response): self
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Auth/SignIn/FailedToSignIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
final class FailedToSignIn extends RuntimeException implements AuthException
{
private ?SignIn $action = null;

private ?ResponseInterface $response = null;

public static function withActionAndResponse(SignIn $action, ResponseInterface $response): self
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Auth/SignInResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ final class SignInResult
* @var non-empty-string|null
*/
private ?string $tenantId = null;

private readonly Parser $parser;

private function __construct()
Expand Down
6 changes: 6 additions & 0 deletions src/Firebase/Auth/SignInWithIdpCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@
final class SignInWithIdpCredentials implements IsTenantAware, SignIn
{
private ?string $accessToken = null;

private ?string $idToken = null;

private ?string $linkingIdToken = null;

private ?string $oauthTokenSecret = null;

private ?string $rawNonce = null;

private string $requestUri = 'http://localhost';

private ?string $tenantId = null;

private function __construct(private readonly string $provider)
Expand Down
2 changes: 2 additions & 0 deletions src/Firebase/Auth/TenantAwareAuthResourceUrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
final class TenantAwareAuthResourceUrlBuilder
{
private const URL_FORMAT = 'https://identitytoolkit.googleapis.com/{version}/projects/{projectId}/tenants/{tenantId}{api}';

private const EMULATOR_URL_FORMAT = 'http://{host}/identitytoolkit.googleapis.com/{version}/projects/{projectId}/tenants/{tenantId}{api}';

private const DEFAULT_API_VERSION = 'v1';

/**
Expand Down
10 changes: 10 additions & 0 deletions src/Firebase/Auth/UserQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,25 @@
class UserQuery implements JsonSerializable
{
final public const FIELD_CREATED_AT = 'CREATED_AT';

final public const FIELD_LAST_LOGIN_AT = 'LAST_LOGIN_AT';

final public const FIELD_NAME = 'NAME';

final public const FIELD_USER_EMAIL = 'USER_EMAIL';

final public const FIELD_USER_ID = 'USER_ID';

final public const FILTER_EMAIL = 'email';

final public const FILTER_PHONE_NUMBER = 'phoneNumber';

final public const FILTER_USER_ID = 'userId';

final public const ORDER_ASC = 'ASC';

final public const ORDER_DESC = 'DESC';

final public const MAX_LIMIT = 500;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Database/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Query implements Stringable
* @var Filter[]
*/
private array $filters = [];

private ?Sorter $sorter = null;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Database/Query/Filter/LimitToFirst.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
final class LimitToFirst implements Filter
{
use ModifierTrait;

private readonly int $limit;

public function __construct(int $limit)
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Database/Query/Filter/LimitToLast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
final class LimitToLast implements Filter
{
use ModifierTrait;

private readonly int $limit;

public function __construct(int $limit)
Expand Down
2 changes: 2 additions & 0 deletions src/Firebase/Database/Reference/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
class Validator
{
final public const MAX_DEPTH = 32;

final public const MAX_KEY_SIZE = 768;

final public const INVALID_KEY_CHARS = '.$#[]';

/**
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/DynamicLink/CreateDynamicLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
final class CreateDynamicLink implements JsonSerializable
{
public const WITH_UNGUESSABLE_SUFFIX = 'UNGUESSABLE';

public const WITH_SHORT_SUFFIX = 'SHORT';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
final class FailedToCreateDynamicLink extends RuntimeException
{
private ?CreateDynamicLink $action = null;

private ?ResponseInterface $response = null;

public static function withActionAndResponse(CreateDynamicLink $action, ResponseInterface $response): self
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/DynamicLink/DynamicLinkStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ final class DynamicLinkStatistics
* @var array<string, list<array<string, string>>>
*/
private array $rawData = [];

private EventStatistics $events;

private function __construct()
Expand Down
2 changes: 2 additions & 0 deletions src/Firebase/DynamicLink/EventStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
final class EventStatistics implements Countable, IteratorAggregate
{
public const PLATFORM_ANDROID = 'ANDROID';

public const PLATFORM_DESKTOP = 'DESKTOP';

public const PLATFORM_IOS = 'IOS';

// Any click on a Dynamic Link, irrespective to how it is handled and its destinations
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/DynamicLink/GetStatisticsForDynamicLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
final class GetStatisticsForDynamicLink
{
public const DEFAULT_DURATION_IN_DAYS = 7;

private int $durationInDays = self::DEFAULT_DURATION_IN_DAYS;

private function __construct(private readonly string $dynamicLink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
final class FailedToGetStatisticsForDynamicLink extends RuntimeException
{
private ?GetStatisticsForDynamicLink $action = null;

private ?ResponseInterface $response = null;

public static function withActionAndResponse(GetStatisticsForDynamicLink $action, ResponseInterface $response): self
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/DynamicLink/ShortenLongDynamicLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
final class ShortenLongDynamicLink implements JsonSerializable
{
public const WITH_UNGUESSABLE_SUFFIX = 'UNGUESSABLE';

public const WITH_SHORT_SUFFIX = 'SHORT';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
final class FailedToShortenLongDynamicLink extends RuntimeException
{
private ?ShortenLongDynamicLink $action = null;

private ?ResponseInterface $response = null;

public static function withActionAndResponse(ShortenLongDynamicLink $action, ResponseInterface $response): self
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Exception/Messaging/QuotaExceeded.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
final class QuotaExceeded extends RuntimeException implements MessagingException
{
use HasErrors;

private ?DateTimeImmutable $retryAfter = null;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Exception/Messaging/ServerUnavailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
final class ServerUnavailable extends RuntimeException implements MessagingException
{
use HasErrors;

private ?DateTimeImmutable $retryAfter = null;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Exception/MessagingApiExceptionConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
class MessagingApiExceptionConverter
{
private readonly ErrorResponseParser $responseParser;

private readonly ClockInterface $clock;

public function __construct(?ClockInterface $clock = null)
Expand Down
7 changes: 7 additions & 0 deletions src/Firebase/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,20 @@ final class Factory
* @var ServiceAccountShape|null
*/
private ?array $serviceAccount = null;

private ?FetchAuthTokenInterface $googleAuthTokenCredentials = null;

/**
* @var non-empty-string|null
*/
private ?string $projectId = null;

private CacheItemPoolInterface $verifierCache;

private CacheItemPoolInterface $authTokenCache;

private CacheItemPoolInterface $keySetCache;

private ClockInterface $clock;

/**
Expand All @@ -118,7 +123,9 @@ final class Factory
* @var non-empty-string|null
*/
private ?string $tenantId = null;

private HttpFactory $httpFactory;

private HttpClientOptions $httpClientOptions;

/**
Expand Down
10 changes: 10 additions & 0 deletions src/Firebase/Messaging/AndroidConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,25 @@
final class AndroidConfig implements JsonSerializable
{
private const MESSAGE_PRIORITY_NORMAL = 'normal';

private const MESSAGE_PRIORITY_HIGH = 'high';

private const NOTIFICATION_PRIORITY_UNSPECIFIED = 'PRIORITY_UNSPECIFIED';

private const NOTIFICATION_PRIORITY_MIN = 'PRIORITY_MIN';

private const NOTIFICATION_PRIORITY_LOW = 'PRIORITY_LOW';

private const NOTIFICATION_PRIORITY_DEFAULT = 'PRIORITY_DEFAULT';

private const NOTIFICATION_PRIORITY_HIGH = 'PRIORITY_HIGH';

private const NOTIFICATION_PRIORITY_MAX = 'PRIORITY_MAX';

private const NOTIFICATION_VISIBILITY_PRIVATE = 'PRIVATE';

private const NOTIFICATION_VISIBILITY_PUBLIC = 'PUBLIC';

private const NOTIFICATION_VISIBILITY_SECRET = 'SECRET';

/**
Expand Down
1 change: 1 addition & 0 deletions src/Firebase/Messaging/ApnsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
final class ApnsConfig implements JsonSerializable
{
private const PRIORITY_CONSERVE_POWER = '5';

private const PRIORITY_IMMEDIATE = '10';

/**
Expand Down
5 changes: 5 additions & 0 deletions src/Firebase/Messaging/CloudMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@
final class CloudMessage implements Message
{
private MessageData $data;

private Notification $notification;

private AndroidConfig $androidConfig;

private ApnsConfig $apnsConfig;

private WebPushConfig $webPushConfig;

private FcmOptions $fcmOptions;

private function __construct(
Expand Down
3 changes: 3 additions & 0 deletions src/Firebase/Messaging/MessageTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
final class MessageTarget
{
public const CONDITION = 'condition';

public const TOKEN = 'token';

public const TOPIC = 'topic';

/**
* @internal
*/
public const UNKNOWN = 'unknown';

public const TYPES = [
self::CONDITION, self::TOKEN, self::TOPIC, self::UNKNOWN,
];
Expand Down
Loading

0 comments on commit 538f35b

Please sign in to comment.