From 82ecb8d40a65fa42ae9ef021d3cef72bb2677474 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Fri, 19 Sep 2025 21:02:38 +0800 Subject: [PATCH 1/2] chore(deps): update huangdijia/php-coding-standard to ^2.4 Updates the PHP coding standard package from ^2.0 to ^2.4 to get the latest improvements and fixes. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9e144ca0b..1dd326c0b 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "elasticsearch/elasticsearch": "^7.0 || ^8.0", "ergebnis/composer-normalize": "^2.43", "hashids/hashids": "^4.1 || ^5.0", - "huangdijia/php-coding-standard": "^2.0", + "huangdijia/php-coding-standard": "^2.4", "hyperf/amqp": "~3.1.0", "hyperf/async-queue": "~3.1.0", "hyperf/cache": "~3.1.0", From ba59fbaa91321f42042e978f0237bde89dc4ab11 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Fri, 19 Sep 2025 21:04:51 +0800 Subject: [PATCH 2/2] style: apply PHP coding standard fixes after updating to ^2.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reorders union types to follow null-first convention and applies other code style improvements as required by the updated huangdijia/php-coding-standard package. This commit includes automatic fixes across multiple components: - Union type reordering (Type|null → null|Type) - Consistent formatting and style improvements - No functional changes, only code style compliance --- src/amqp-job/src/Functions.php | 8 +++--- src/cache/src/Contract/Repository.php | 8 +++--- src/cache/src/Facade/Cache.php | 8 +++--- src/cache/src/Repository.php | 2 +- src/command-signals/src/SignalRegistry.php | 4 +-- .../src/Traits/InteractsWithSignals.php | 2 +- .../Eloquent/Concerns/HasRelationships.php | 12 ++++----- .../Database/Eloquent/Relations/BelongsTo.php | 2 +- .../Database/Eloquent/Relations/HasOne.php | 2 +- src/config-consul/src/KV.php | 4 +-- .../ExceptionHandlerDispatcherAspect.php | 2 +- src/exception-event/src/Functions.php | 4 +-- src/facade/src/AsyncQueue.php | 2 +- src/facade/src/Kafka.php | 2 +- .../src/Annotation/ValidationAspect.php | 2 +- src/helpers/src/Functions.php | 20 +++++++------- src/http-client/src/Factory.php | 8 +++--- src/http-client/src/PendingRequest.php | 26 +++++++++---------- src/http-client/src/Request.php | 4 +-- src/http-client/src/Response.php | 14 +++++----- src/http-client/src/ResponseSequence.php | 2 +- src/ide-helper/src/Macro.php | 2 +- src/ipc-broadcaster/src/ServerBroadcaster.php | 2 +- src/lock/src/Annotation/BlockableAspect.php | 2 +- src/lock/src/Driver/AbstractLock.php | 2 +- src/lock/src/Driver/CoroutineLock.php | 4 +-- src/lock/src/Driver/LockInterface.php | 4 +-- src/macros/output/Hyperf/Collection/Arr.php | 10 +++---- .../HttpServer/Contract/RequestInterface.php | 10 +++---- src/macros/output/Hyperf/Stringable/Str.php | 4 +-- .../output/Hyperf/Stringable/Stringable.php | 2 +- src/macros/src/ArrMixin.php | 10 +++---- src/mail/src/Contract/Mailer.php | 2 +- src/mail/src/Functions.php | 2 +- src/mail/src/Mailable/Address.php | 2 +- src/mail/src/Mailable/Content.php | 14 +++++----- src/mail/src/Mailable/Envelope.php | 16 ++++++------ src/mail/src/Mailable/Headers.php | 2 +- src/mail/src/Mailer.php | 6 ++--- src/mail/src/Message.php | 6 ++--- src/model-factory/src/Functions.php | 2 +- src/model-hashids/src/Concerns/HasHashid.php | 6 ++--- .../src/Concerns/HashidRouting.php | 2 +- .../src/Aspect/UdpSocketAspect.php | 2 +- .../src/Message/MailMessage.php | 2 +- src/notification/src/DatabaseNotification.php | 2 +- src/notification/src/NotificationSender.php | 2 +- .../src/Event/ScopeResolveEvent.php | 4 +-- src/oauth2-server/src/Model/AccessToken.php | 2 +- .../src/Model/AuthorizationCode.php | 2 +- src/oauth2-server/src/Model/Device.php | 2 +- .../src/Repository/ScopeRepository.php | 2 +- .../src/Repository/UserRepository.php | 2 +- .../src/View/Components/Choice.php | 2 +- .../src/View/Components/Task.php | 2 +- .../src/View/Components/TwoColumnDetail.php | 2 +- src/purifier/src/Casts/WithConfig.php | 2 +- src/purifier/src/Functions.php | 2 +- src/purifier/src/Purifier.php | 6 ++--- src/redis-subscriber/src/CommandBuilder.php | 2 +- src/redis-subscriber/src/CommandInvoker.php | 4 +-- src/sentry/class_map/SentrySdk.php | 2 +- src/sentry/src/Aspect/BreadcrumbAspect.php | 2 +- src/sentry/src/Aspect/LoggerAspect.php | 2 +- src/sentry/src/Factory/HubFactory.php | 2 +- src/sentry/src/Integration/RequestFetcher.php | 2 +- .../src/Integration/RequestIntegration.php | 2 +- src/sentry/src/Monolog/LogsHandler.php | 2 +- .../src/Tracing/Aspect/AmqpProducerAspect.php | 4 +-- .../Aspect/AsyncQueueJobMessageAspect.php | 2 +- src/sentry/src/Tracing/Aspect/RpcAspect.php | 2 +- .../Tracing/Aspect/TraceAnnotationAspect.php | 2 +- .../Tracing/Listener/TracingAmqpListener.php | 4 +-- .../Listener/TracingAsyncQueueListener.php | 4 +-- .../Tracing/Listener/TracingKafkaListener.php | 2 +- src/sentry/src/Tracing/SpanStarter.php | 2 +- src/sentry/src/Transport/CoHttpTransport.php | 2 +- src/sentry/src/Util/SafeCaller.php | 2 +- src/support/src/Contract/HubInterface.php | 2 +- src/support/src/Env.php | 2 +- src/support/src/Functions.php | 2 +- src/support/src/Number.php | 2 +- src/support/src/Once.php | 2 +- src/support/src/Once/Cache.php | 2 +- src/support/src/Onceable.php | 6 ++--- src/support/src/Pipeline/Hub.php | 2 +- src/support/src/Sleep.php | 2 +- src/tcp-sender/src/PipeMessage.php | 2 +- src/tcp-sender/src/Sender.php | 2 +- .../ElasticsearchEntriesRepository.php | 2 +- .../src/Aspect/GrpcCoreMiddlewareAspect.php | 4 +-- src/telescope/src/Avatar.php | 6 ++--- src/telescope/src/EntryResult.php | 2 +- src/telescope/src/IncomingEntry.php | 2 +- .../src/Storage/EntryQueryOptions.php | 4 +-- src/telescope/src/TelescopeContext.php | 2 +- .../src/Subscriber/TriggerSubscriber.php | 2 +- tests/Concerns/InteractsWithContainer.php | 2 +- 98 files changed, 193 insertions(+), 193 deletions(-) diff --git a/src/amqp-job/src/Functions.php b/src/amqp-job/src/Functions.php index 52a258aeb..1cdad6e0b 100644 --- a/src/amqp-job/src/Functions.php +++ b/src/amqp-job/src/Functions.php @@ -18,14 +18,14 @@ /** * Dispatch a job to a queue. * - * @param string|null $exchange deprecated since v3.1, will be removed in v3.2 - * @param string|array|null $routingKey deprecated since v3.1, will be removed in v3.2 - * @param string|null $pool deprecated since v3.1, will be removed in v3.2 + * @param null|string $exchange deprecated since v3.1, will be removed in v3.2 + * @param null|string|array $routingKey deprecated since v3.1, will be removed in v3.2 + * @param null|string $pool deprecated since v3.1, will be removed in v3.2 */ function dispatch( JobInterface $payload, ?string $exchange = null, - string|array|null $routingKey = null, + null|string|array $routingKey = null, ?string $pool = null, ?bool $confirm = null, ?int $timeout = null diff --git a/src/cache/src/Contract/Repository.php b/src/cache/src/Contract/Repository.php index d3d123def..f668d1bbd 100644 --- a/src/cache/src/Contract/Repository.php +++ b/src/cache/src/Contract/Repository.php @@ -21,7 +21,7 @@ interface Repository extends \Psr\SimpleCache\CacheInterface /** * @param string $key * @param mixed $value - * @param DateInterval|DateTimeInterface|int|null $ttl + * @param null|DateInterval|DateTimeInterface|int $ttl */ public function add($key, $value, $ttl = null): bool; @@ -33,7 +33,7 @@ public function add($key, $value, $ttl = null): bool; * @param string $key * @param array{ 0: DateTimeInterface|DateInterval|int, 1: DateTimeInterface|DateInterval|int } $ttl * @param (callable(): TCacheValue) $callback - * @param array{ seconds?: int, owner?: string }|null $lock + * @param null|array{ seconds?: int, owner?: string } $lock * @return TCacheValue */ public function flexible($key, $ttl, $callback, $lock = null); @@ -71,7 +71,7 @@ public function missing($key): bool; /** * @param array|string $key * @param mixed $value - * @param DateInterval|DateTimeInterface|int|null $ttl + * @param null|DateInterval|DateTimeInterface|int $ttl */ public function put($key, $value, $ttl = null): bool; @@ -113,7 +113,7 @@ public function pull($key, $default = null); * @template TCacheValue * * @param string $key - * @param DateInterval|DateTimeInterface|int|null $ttl + * @param null|DateInterval|DateTimeInterface|int $ttl * @param Closure(): TCacheValue $callback * @return TCacheValue */ diff --git a/src/cache/src/Facade/Cache.php b/src/cache/src/Facade/Cache.php index bbead62fc..3ce630ee2 100644 --- a/src/cache/src/Facade/Cache.php +++ b/src/cache/src/Facade/Cache.php @@ -48,7 +48,7 @@ public static function resolve(string $name): Repository /** * @param string $key * @param mixed $value - * @param DateInterval|DateTimeInterface|int|null $ttl + * @param null|DateInterval|DateTimeInterface|int $ttl */ public static function add($key, $value, $ttl = null): bool { @@ -63,7 +63,7 @@ public static function add($key, $value, $ttl = null): bool * @param string $key * @param array{ 0: DateTimeInterface|DateInterval|int, 1: DateTimeInterface|DateInterval|int } $ttl * @param (callable(): TCacheValue) $callback - * @param array{ seconds?: int, owner?: string }|null $lock + * @param null|array{ seconds?: int, owner?: string } $lock * @return TCacheValue */ public static function flexible($key, $ttl, $callback, $lock = null) @@ -116,7 +116,7 @@ public static function missing($key): bool /** * @param array|string $key * @param mixed $value - * @param DateInterval|DateTimeInterface|int|null $ttl + * @param null|DateInterval|DateTimeInterface|int $ttl */ public static function put($key, $value, $ttl = null): bool { @@ -190,7 +190,7 @@ public static function pull($key, $default = null) * @template TCacheValue * * @param string $key - * @param DateInterval|DateTimeInterface|int|null $ttl + * @param null|DateInterval|DateTimeInterface|int $ttl * @param Closure(): TCacheValue $callback * @return TCacheValue */ diff --git a/src/cache/src/Repository.php b/src/cache/src/Repository.php index 516476b9a..23641190f 100644 --- a/src/cache/src/Repository.php +++ b/src/cache/src/Repository.php @@ -69,7 +69,7 @@ public function __clone() /** * @param string $key * @param mixed $value - * @param int|DateInterval|null $ttl + * @param null|int|DateInterval $ttl */ public function set($key, $value, $ttl = null): bool { diff --git a/src/command-signals/src/SignalRegistry.php b/src/command-signals/src/SignalRegistry.php index 3a440852a..c5a2fb165 100644 --- a/src/command-signals/src/SignalRegistry.php +++ b/src/command-signals/src/SignalRegistry.php @@ -49,9 +49,9 @@ public function register(int|array $signo, callable $signalHandler): void } /** - * @param int|int[]|null $signo + * @param null|int|int[] $signo */ - public function unregister(int|array|null $signo = null): void + public function unregister(null|int|array $signo = null): void { match (true) { // Unregister all signals diff --git a/src/command-signals/src/Traits/InteractsWithSignals.php b/src/command-signals/src/Traits/InteractsWithSignals.php index af0a37555..5793e7fd1 100644 --- a/src/command-signals/src/Traits/InteractsWithSignals.php +++ b/src/command-signals/src/Traits/InteractsWithSignals.php @@ -36,7 +36,7 @@ protected function trap(array|int $signo, callable $callback): void $this->signalRegistry->register($signo, $callback); } - protected function untrap(array|int|null $signo = null): void + protected function untrap(null|array|int $signo = null): void { $this->signalRegistry?->unregister($signo); } diff --git a/src/compoships/src/Database/Eloquent/Concerns/HasRelationships.php b/src/compoships/src/Database/Eloquent/Concerns/HasRelationships.php index 28f3dc114..1a864f219 100644 --- a/src/compoships/src/Database/Eloquent/Concerns/HasRelationships.php +++ b/src/compoships/src/Database/Eloquent/Concerns/HasRelationships.php @@ -51,8 +51,8 @@ public function getQualifiedKeyName() * Define a one-to-one relationship. * * @param string $related - * @param array|string|null $foreignKey - * @param array|string|null $localKey + * @param null|array|string $foreignKey + * @param null|array|string $localKey * * @return HasOne */ @@ -85,8 +85,8 @@ public function hasOne($related, $foreignKey = null, $localKey = null) * Define a one-to-many relationship. * * @param string $related - * @param array|string|null $foreignKey - * @param array|string|null $localKey + * @param null|array|string $foreignKey + * @param null|array|string $localKey * * @return HasMany */ @@ -119,8 +119,8 @@ public function hasMany($related, $foreignKey = null, $localKey = null) * Define an inverse one-to-one or many relationship. * * @param string $related - * @param array|string|null $foreignKey - * @param array|string|null $ownerKey + * @param null|array|string $foreignKey + * @param null|array|string $ownerKey * @param string $relation * * @return BelongsTo diff --git a/src/compoships/src/Database/Eloquent/Relations/BelongsTo.php b/src/compoships/src/Database/Eloquent/Relations/BelongsTo.php index a31de8b03..f320fd79c 100755 --- a/src/compoships/src/Database/Eloquent/Relations/BelongsTo.php +++ b/src/compoships/src/Database/Eloquent/Relations/BelongsTo.php @@ -42,7 +42,7 @@ public function getResults() /** * Associate the model instance to the given parent. * - * @param int|Model|string|null $model + * @param null|int|Model|string $model * * @return Model */ diff --git a/src/compoships/src/Database/Eloquent/Relations/HasOne.php b/src/compoships/src/Database/Eloquent/Relations/HasOne.php index 282ca08b4..9736b01dc 100755 --- a/src/compoships/src/Database/Eloquent/Relations/HasOne.php +++ b/src/compoships/src/Database/Eloquent/Relations/HasOne.php @@ -90,7 +90,7 @@ public function newRelatedInstanceFor(Model $parent) /** * Get the default value for this relation. * - * @return Model|null + * @return null|Model */ protected function getDefaultFor(Model $model) { diff --git a/src/config-consul/src/KV.php b/src/config-consul/src/KV.php index 473995026..da2de9981 100644 --- a/src/config-consul/src/KV.php +++ b/src/config-consul/src/KV.php @@ -15,13 +15,13 @@ class KV { - public int|string|null $lockIndex = null; + public null|int|string $lockIndex = null; public ?string $key = null; public ?string $value = null; - public int|string|null $flags = null; + public null|int|string $flags = null; public ?int $createIndex = null; diff --git a/src/exception-event/src/Aspect/ExceptionHandlerDispatcherAspect.php b/src/exception-event/src/Aspect/ExceptionHandlerDispatcherAspect.php index fe3ddb523..7c772fc9d 100644 --- a/src/exception-event/src/Aspect/ExceptionHandlerDispatcherAspect.php +++ b/src/exception-event/src/Aspect/ExceptionHandlerDispatcherAspect.php @@ -36,7 +36,7 @@ public function __construct(protected EventDispatcherInterface $eventDispatcher) public function process(ProceedingJoinPoint $proceedingJoinPoint) { return tap($proceedingJoinPoint->process(), function ($responseHandled) use ($proceedingJoinPoint) { - /** @var Throwable|null $exception */ + /** @var null|Throwable $exception */ $exception = isset($proceedingJoinPoint->arguments['variadic']) ? ($proceedingJoinPoint->getArguments()[0] ?? null) : ($proceedingJoinPoint->getArguments()[0][0] ?? null); diff --git a/src/exception-event/src/Functions.php b/src/exception-event/src/Functions.php index a3bac12ab..0db5c42c8 100644 --- a/src/exception-event/src/Functions.php +++ b/src/exception-event/src/Functions.php @@ -36,9 +36,9 @@ function report(string|Throwable $exception = 'RuntimeException', ...$parameters return; } - /** @var ServerRequestInterface|null $request */ + /** @var null|ServerRequestInterface $request */ $request = Context::get(ServerRequestInterface::class); - /** @var ResponseInterface|null $response */ + /** @var null|ResponseInterface $response */ $response = Context::get(ResponseInterface::class); $container->get(EventDispatcherInterface::class)->dispatch(new ExceptionDispatched($exception, $request, $response)); } diff --git a/src/facade/src/AsyncQueue.php b/src/facade/src/AsyncQueue.php index 257032d96..5e47a9e96 100644 --- a/src/facade/src/AsyncQueue.php +++ b/src/facade/src/AsyncQueue.php @@ -17,7 +17,7 @@ /** * @mixin DriverFactory - * @property string|null $queue + * @property null|string $queue */ class AsyncQueue extends Facade { diff --git a/src/facade/src/Kafka.php b/src/facade/src/Kafka.php index 65439f138..8528f1314 100644 --- a/src/facade/src/Kafka.php +++ b/src/facade/src/Kafka.php @@ -17,7 +17,7 @@ /** * @mixin ProducerManager - * @property string|null $queue + * @property null|string $queue */ class Kafka extends Facade { diff --git a/src/grpc-validation/src/Annotation/ValidationAspect.php b/src/grpc-validation/src/Annotation/ValidationAspect.php index 7514ab980..7de97aa70 100644 --- a/src/grpc-validation/src/Annotation/ValidationAspect.php +++ b/src/grpc-validation/src/Annotation/ValidationAspect.php @@ -61,7 +61,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) protected function getValidationRules(ProceedingJoinPoint $proceedingJoinPoint): array { $metadata = $proceedingJoinPoint->getAnnotationMetadata(); - /** @var Validation|null $annotation */ + /** @var null|Validation $annotation */ $annotation = $metadata->method[Validation::class] ?? null; if (! $annotation) { diff --git a/src/helpers/src/Functions.php b/src/helpers/src/Functions.php index 9f9703f93..417c169f0 100644 --- a/src/helpers/src/Functions.php +++ b/src/helpers/src/Functions.php @@ -64,7 +64,7 @@ * * @return ($abstract is callable ? Closure : ($abstract is class-string ? TClass : mixed)) */ -function app(string|callable|null $abstract = null, array $parameters = []) +function app(null|string|callable $abstract = null, array $parameters = []) { if (is_callable($abstract)) { return Closure::fromCallable($abstract); @@ -161,7 +161,7 @@ function class_namespace($class): string * * @template TClass * - * @param class-string|string|null $abstract + * @param null|class-string|string $abstract * * @return ($abstract is null ? ContainerInterface : ($abstract is class-string ? TClass : mixed)) */ @@ -323,7 +323,7 @@ function literal(...$arguments) } /** - * @param string|Stringable|null $message + * @param null|string|Stringable $message * @return ($message is null ? LoggerInterface : mixed) */ function logger($message = null, array $context = [], bool $backtrace = false) @@ -348,7 +348,7 @@ function logs(string $name = 'hyperf', string $group = 'default'): LoggerInterfa /** * Create a new Carbon instance for the current time. * - * @param DateTimeZone|string|null $tz + * @param null|DateTimeZone|string $tz * * @deprecated since v3.1, use Hyperf\Support\now() instead, will be removed in v3.2 */ @@ -363,7 +363,7 @@ function now($tz = null): Carbon * @template TValue of object * * @param TValue $object - * @param string|null $key + * @param null|string $key * @param mixed $default * @return ($key is empty ? TValue : mixed) */ @@ -416,7 +416,7 @@ function resolve(string|callable $abstract, array $parameters = []) /** * Get an instance of the current request or an input item from the request. - * @param array|string|null $key + * @param null|array|string $key * @param mixed $default * @return ($key is null ? RequestInterface : ($key is array ? array : mixed)) */ @@ -438,7 +438,7 @@ function request($key = null, $default = null) /** * Return a new response from the application. * - * @param array|string|null $content + * @param null|array|string $content * @param int $status * @return PsrResponseInterface|ResponseInterface */ @@ -475,7 +475,7 @@ function ($response) use ($headers) { * * @param callable(): TValue $callback * @param (callable(Throwable): TFallback)|TFallback $rescue - * @param Closure(Throwable): void|null $exceptionHandler + * @param null|Closure(Throwable): void $exceptionHandler * @return TValue|TFallback */ function rescue(callable $callback, mixed $rescue = null, ?Closure $exceptionHandler = null) @@ -496,7 +496,7 @@ function rescue(callable $callback, mixed $rescue = null, ?Closure $exceptionHan * * If an array is passed as the key, we will assume you want to set an array of values. * - * @param array|string|null $key + * @param null|array|string $key * @param mixed $default * @return ($key is null ? SessionInterface : ($key is array ? void : mixed)) */ @@ -519,7 +519,7 @@ function session($key = null, $default = null) /** * Create a new Carbon instance for the current date. * - * @param DateTimeZone|string|null $tz + * @param null|DateTimeZone|string $tz * * @deprecated since v3.1, use Hyperf\Support\today() instead, will be removed in v3.2 */ diff --git a/src/http-client/src/Factory.php b/src/http-client/src/Factory.php index 3aa3b56e9..0e8280b36 100644 --- a/src/http-client/src/Factory.php +++ b/src/http-client/src/Factory.php @@ -80,7 +80,7 @@ class Factory /** * The event dispatcher implementation. * - * @var EventDispatcherInterface|null + * @var null|EventDispatcherInterface */ protected $dispatcher; @@ -203,7 +203,7 @@ public function globalResponseMiddleware($middleware) /** * Create a new response instance for use during stubbing. * - * @param array|string|null $body + * @param null|array|string $body * @param int $status * @param array $headers * @return PromiseInterface @@ -234,7 +234,7 @@ public function sequence(array $responses = []) /** * Register a stub callable that will intercept requests and be able to return stub responses. * - * @param array|callable|null $callback + * @param null|array|callable $callback * @return $this */ public function fake($callback = null) @@ -461,7 +461,7 @@ public function recorded($callback = null) /** * Get the current event dispatcher implementation. * - * @return EventDispatcherInterface|null + * @return null|EventDispatcherInterface */ public function getDispatcher() { diff --git a/src/http-client/src/PendingRequest.php b/src/http-client/src/PendingRequest.php index 78cdbb329..0653b25af 100644 --- a/src/http-client/src/PendingRequest.php +++ b/src/http-client/src/PendingRequest.php @@ -53,14 +53,14 @@ class PendingRequest /** * The factory instance. * - * @var Factory|null + * @var null|Factory */ protected $factory; /** * The Guzzle client instance. * - * @var Client|null + * @var null|Client */ protected $client; @@ -116,7 +116,7 @@ class PendingRequest /** * The transfer stats for the request. * - * @var \GuzzleHttp\TransferStats|null + * @var null|\GuzzleHttp\TransferStats */ protected $transferStats; @@ -130,7 +130,7 @@ class PendingRequest /** * A callback to run when throwing if a server or client error occurs. * - * @var Closure|null + * @var null|Closure */ protected $throwCallback; @@ -149,14 +149,14 @@ class PendingRequest protected $tries = 1; /** - * @var int[]|null + * @var null|int[] */ protected $backoff; /** * The number of milliseconds to wait between retries. * - * @var Closure|int|null + * @var null|Closure|int */ protected $retryDelay = 100; @@ -170,7 +170,7 @@ class PendingRequest /** * The callback that will determine if the request should be retried. * - * @var callable|null + * @var null|callable */ protected $retryWhenCallback; @@ -184,7 +184,7 @@ class PendingRequest /** * The stub callables that will handle requests. * - * @var Collection|null + * @var null|Collection */ protected $stubCallbacks; @@ -219,7 +219,7 @@ class PendingRequest /** * The sent request object, if a request has been made. * - * @var Request|null + * @var null|Request */ protected $request; @@ -317,7 +317,7 @@ public function asForm() * * @param array|string $name * @param resource|string $contents - * @param string|null $filename + * @param null|string $filename * @return $this */ public function attach($name, $contents = '', $filename = null, array $headers = []) @@ -758,7 +758,7 @@ public function dd() /** * Issue a GET request to the given URL. * - * @param array|string|null $query + * @param null|array|string $query * @return Response */ public function get(string $url, $query = null) @@ -771,7 +771,7 @@ public function get(string $url, $query = null) /** * Issue a HEAD request to the given URL. * - * @param array|string|null $query + * @param null|array|string $query * @return Response */ public function head(string $url, $query = null) @@ -1144,7 +1144,7 @@ public function async(bool $async = true) /** * Retrieve the pending request promise. * - * @return \GuzzleHttp\Promise\PromiseInterface|null + * @return null|\GuzzleHttp\Promise\PromiseInterface */ public function getPromise() { diff --git a/src/http-client/src/Request.php b/src/http-client/src/Request.php index 0faab063f..3b8fbc16c 100644 --- a/src/http-client/src/Request.php +++ b/src/http-client/src/Request.php @@ -146,8 +146,8 @@ public function body() * Determine if the request contains the given file. * * @param string $name - * @param string|null $value - * @param string|null $filename + * @param null|string $value + * @param null|string $filename * @return bool */ public function hasFile($name, $value = null, $filename = null) diff --git a/src/http-client/src/Response.php b/src/http-client/src/Response.php index fbc01291c..e4bc85a8f 100644 --- a/src/http-client/src/Response.php +++ b/src/http-client/src/Response.php @@ -40,7 +40,7 @@ class Response implements ArrayAccess, Stringable /** * The transfer stats for the request. * - * @var \GuzzleHttp\TransferStats|null + * @var null|\GuzzleHttp\TransferStats */ public $transferStats; @@ -105,7 +105,7 @@ public function body() /** * Get the JSON decoded body of the response as an array or scalar value. * - * @param string|null $key + * @param null|string $key * @param mixed $default * @return mixed */ @@ -125,7 +125,7 @@ public function json($key = null, $default = null) /** * Get the JSON decoded body of the response as an object. * - * @return object|null + * @return null|object */ public function object() { @@ -135,7 +135,7 @@ public function object() /** * Get the JSON decoded body of the response as a collection. * - * @param string|null $key + * @param null|string $key * @return Collection */ public function collect($key = null) @@ -146,7 +146,7 @@ public function collect($key = null) /** * Get the JSON decoded body of the response as a fluent object. * - * @param string|null $key + * @param null|string $key * @return Fluent */ public function fluent($key = null) @@ -197,7 +197,7 @@ public function reason() /** * Get the effective URI of the response. * - * @return \Psr\Http\Message\UriInterface|null + * @return null|\Psr\Http\Message\UriInterface */ public function effectiveUri() { @@ -313,7 +313,7 @@ public function toPsrResponse() /** * Create an exception if a server or client error occurred. * - * @return RequestException|null + * @return null|RequestException */ public function toException() { diff --git a/src/http-client/src/ResponseSequence.php b/src/http-client/src/ResponseSequence.php index aa0116738..910757f31 100644 --- a/src/http-client/src/ResponseSequence.php +++ b/src/http-client/src/ResponseSequence.php @@ -72,7 +72,7 @@ public function __invoke() /** * Push a response to the sequence. * - * @param array|string|null $body + * @param null|array|string $body * @return $this */ public function push($body = null, int $status = 200, array $headers = []) diff --git a/src/ide-helper/src/Macro.php b/src/ide-helper/src/Macro.php index cd1d40075..029d0fafd 100644 --- a/src/ide-helper/src/Macro.php +++ b/src/ide-helper/src/Macro.php @@ -68,7 +68,7 @@ protected function addLocationToPhpDoc(): void { $enclosingClass = $this->method->getClosureScopeClass(); - /** @var ReflectionMethod|null $enclosingMethod */ + /** @var null|ReflectionMethod $enclosingMethod */ $enclosingMethod = Collection::make($enclosingClass->getMethods()) ->first(function (ReflectionMethod $method) { return $method->getStartLine() <= $this->method->getStartLine() diff --git a/src/ipc-broadcaster/src/ServerBroadcaster.php b/src/ipc-broadcaster/src/ServerBroadcaster.php index 5ba3f6a26..58c825795 100644 --- a/src/ipc-broadcaster/src/ServerBroadcaster.php +++ b/src/ipc-broadcaster/src/ServerBroadcaster.php @@ -26,7 +26,7 @@ class ServerBroadcaster implements BroadcasterInterface protected $server; /** - * @param int|null $id WorkerId + * @param null|int $id WorkerId */ public function __construct( private ContainerInterface $container, diff --git a/src/lock/src/Annotation/BlockableAspect.php b/src/lock/src/Annotation/BlockableAspect.php index cdd3dc258..eef17789e 100644 --- a/src/lock/src/Annotation/BlockableAspect.php +++ b/src/lock/src/Annotation/BlockableAspect.php @@ -30,7 +30,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) { $arguments = $proceedingJoinPoint->arguments['keys'] ?? []; $annotationMetadata = $proceedingJoinPoint->getAnnotationMetadata(); - /** @var Blockable|null $annotation */ + /** @var null|Blockable $annotation */ $annotation = $annotationMetadata->method[Blockable::class] ?? null; if (! $annotation || $annotation->seconds <= 0) { diff --git a/src/lock/src/Driver/AbstractLock.php b/src/lock/src/Driver/AbstractLock.php index a314c04b8..80fbc7708 100644 --- a/src/lock/src/Driver/AbstractLock.php +++ b/src/lock/src/Driver/AbstractLock.php @@ -124,7 +124,7 @@ public function betweenBlockedAttemptsSleepFor($milliseconds): self /** * Determine whether this lock is owned by the given identifier. * - * @param string|null $owner + * @param null|string $owner */ public function isOwnedBy($owner): bool { diff --git a/src/lock/src/Driver/CoroutineLock.php b/src/lock/src/Driver/CoroutineLock.php index 25d09a721..099b134d1 100644 --- a/src/lock/src/Driver/CoroutineLock.php +++ b/src/lock/src/Driver/CoroutineLock.php @@ -25,14 +25,14 @@ class CoroutineLock extends AbstractLock protected static array $channels = []; /** - * @var WeakMap|null + * @var null|WeakMap */ protected static ?WeakMap $owners = null; protected static ?Timer $timer = null; /** - * @var WeakMap|null + * @var null|WeakMap */ protected static ?WeakMap $timers = null; diff --git a/src/lock/src/Driver/LockInterface.php b/src/lock/src/Driver/LockInterface.php index c852c2d24..518d27b0f 100644 --- a/src/lock/src/Driver/LockInterface.php +++ b/src/lock/src/Driver/LockInterface.php @@ -18,7 +18,7 @@ interface LockInterface /** * Attempt to acquire the lock. * @template T - * @param (callable(): T)|null $callback + * @param null|(callable(): T) $callback * @return ($callback is null ? bool : T) */ public function get(?callable $callback = null); @@ -27,7 +27,7 @@ public function get(?callable $callback = null); * Attempt to acquire the lock for the given number of seconds. * * @template T - * @param (callable(): T)|null $callback + * @param null|(callable(): T) $callback * @return ($callback is null ? bool : T) * @throws LockTimeoutException */ diff --git a/src/macros/output/Hyperf/Collection/Arr.php b/src/macros/output/Hyperf/Collection/Arr.php index d04d3778c..d58353f13 100644 --- a/src/macros/output/Hyperf/Collection/Arr.php +++ b/src/macros/output/Hyperf/Collection/Arr.php @@ -31,7 +31,7 @@ public static function arrayable($value) * @return array * @throws InvalidArgumentException */ - public static function array(ArrayAccess|array $array, string|int|null $key, ?array $default = null) + public static function array(ArrayAccess|array $array, null|string|int $key, ?array $default = null) { } @@ -40,7 +40,7 @@ public static function array(ArrayAccess|array $array, string|int|null $key, ?ar * @return bool * @throws InvalidArgumentException */ - public static function boolean(ArrayAccess|array $array, string|int|null $key, ?bool $default = null) + public static function boolean(ArrayAccess|array $array, null|string|int $key, ?bool $default = null) { } @@ -60,7 +60,7 @@ public static function every($array, callable $callback) * @return float * @throws InvalidArgumentException */ - public static function float(ArrayAccess|array $array, string|int|null $key, ?float $default = null) + public static function float(ArrayAccess|array $array, null|string|int $key, ?float $default = null) { } @@ -95,7 +95,7 @@ public static function hasAll($array, $keys) * @return int * @throws InvalidArgumentException */ - public static function integer(ArrayAccess|array $array, string|int|null $key, ?int $default = null) + public static function integer(ArrayAccess|array $array, null|string|int $key, ?int $default = null) { } @@ -104,7 +104,7 @@ public static function integer(ArrayAccess|array $array, string|int|null $key, ? * @return string * @throws InvalidArgumentException */ - public static function string(ArrayAccess|array $array, string|int|null $key, ?string $default = null) + public static function string(ArrayAccess|array $array, null|string|int $key, ?string $default = null) { } diff --git a/src/macros/output/Hyperf/HttpServer/Contract/RequestInterface.php b/src/macros/output/Hyperf/HttpServer/Contract/RequestInterface.php index 464fe0655..0510cf866 100644 --- a/src/macros/output/Hyperf/HttpServer/Contract/RequestInterface.php +++ b/src/macros/output/Hyperf/HttpServer/Contract/RequestInterface.php @@ -34,7 +34,7 @@ public function anyFilled($keys): bool; * * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. * - * @param string|null $key + * @param null|string $key * @param bool $default */ public function boolean($key = null, $default = false): bool; @@ -42,7 +42,7 @@ public function boolean($key = null, $default = false): bool; /** * Retrieve input from the request as a collection. */ - public function collect(array|string|null $key = null): \Hyperf\Collection\Collection; + public function collect(null|array|string $key = null): \Hyperf\Collection\Collection; /** * Retrieve input from the request as a Carbon instance. @@ -57,7 +57,7 @@ public function date(string $key, ?string $format = null, ?string $tz = null): ? public function except($keys): array; /** - * @param Closure(ServerRequestInterface):ServerRequestInterface|null $closure + * @param null|Closure(ServerRequestInterface):ServerRequestInterface $closure */ public static function fake(?Closure $closure = null): ServerRequestInterface; @@ -71,7 +71,7 @@ public function float(string $key, $default = null): float; /** * Retrieve input from the request as a Fluent object instance. */ - public function fluent(array|string|null $key = null): Fluent; + public function fluent(null|array|string $key = null): Fluent; /** * Determine if the request contains any of the given inputs. @@ -181,7 +181,7 @@ public function isJson(): bool; * * @param string $key * @param class-string $enumClass - * @return TEnum|null + * @return null|TEnum */ public function enum($key, $enumClass); diff --git a/src/macros/output/Hyperf/Stringable/Str.php b/src/macros/output/Hyperf/Stringable/Str.php index 05476b3d0..dbcc9946d 100644 --- a/src/macros/output/Hyperf/Stringable/Str.php +++ b/src/macros/output/Hyperf/Stringable/Str.php @@ -60,8 +60,8 @@ public static function inlineMarkdown($string, array $options = []) * Transliterate a string to its closest ASCII representation. * * @param string $string - * @param string|null $unknown - * @param bool|null $strict + * @param null|string $unknown + * @param null|bool $strict * @return string */ public static function transliterate($string, $unknown = '?', $strict = false) diff --git a/src/macros/output/Hyperf/Stringable/Stringable.php b/src/macros/output/Hyperf/Stringable/Stringable.php index 107158421..d95631f80 100644 --- a/src/macros/output/Hyperf/Stringable/Stringable.php +++ b/src/macros/output/Hyperf/Stringable/Stringable.php @@ -80,7 +80,7 @@ public function toHtmlString() * Execute the given callback if the string is 7 bit ASCII. * * @param callable $callback - * @param callable|null $default + * @param null|callable $default * @return static */ public function whenIsAscii($callback, $default = null) diff --git a/src/macros/src/ArrMixin.php b/src/macros/src/ArrMixin.php index 3e6c1c7e6..7ca94df4e 100644 --- a/src/macros/src/ArrMixin.php +++ b/src/macros/src/ArrMixin.php @@ -37,7 +37,7 @@ public function arrayable() public function array() { - return function (ArrayAccess|array $array, string|int|null $key, ?array $default = null) { + return function (ArrayAccess|array $array, null|string|int $key, ?array $default = null) { $value = Arr::get($array, $key, $default); if (! is_array($value)) { @@ -55,7 +55,7 @@ public function array() */ public function boolean() { - return function (ArrayAccess|array $array, string|int|null $key, ?bool $default = null) { + return function (ArrayAccess|array $array, null|string|int $key, ?bool $default = null) { $value = Arr::get($array, $key, $default); if (! is_bool($value)) { @@ -78,7 +78,7 @@ public static function every() */ public function float() { - return function (ArrayAccess|array $array, string|int|null $key, ?float $default = null) { + return function (ArrayAccess|array $array, null|string|int $key, ?float $default = null) { $value = Arr::get($array, $key, $default); if (! is_float($value)) { @@ -130,7 +130,7 @@ public static function hasAll() */ public function integer() { - return function (ArrayAccess|array $array, string|int|null $key, ?int $default = null) { + return function (ArrayAccess|array $array, null|string|int $key, ?int $default = null) { $value = Arr::get($array, $key, $default); if (! is_integer($value)) { @@ -148,7 +148,7 @@ public function integer() */ public function string() { - return function (ArrayAccess|array $array, string|int|null $key, ?string $default = null) { + return function (ArrayAccess|array $array, null|string|int $key, ?string $default = null) { $value = Arr::get($array, $key, $default); if (! is_string($value)) { diff --git a/src/mail/src/Contract/Mailer.php b/src/mail/src/Contract/Mailer.php index b3d17a46b..4d1456438 100644 --- a/src/mail/src/Contract/Mailer.php +++ b/src/mail/src/Contract/Mailer.php @@ -36,5 +36,5 @@ public function raw(string $text, mixed $callback): ?SentMessage; /** * Send a new message using a view. */ - public function send(Mailable|string|array $view, array $data = [], Closure|string|null $callback = null): ?SentMessage; + public function send(Mailable|string|array $view, array $data = [], null|Closure|string $callback = null): ?SentMessage; } diff --git a/src/mail/src/Functions.php b/src/mail/src/Functions.php index e6f3c76b2..da695abcc 100644 --- a/src/mail/src/Functions.php +++ b/src/mail/src/Functions.php @@ -18,7 +18,7 @@ /** * Encode HTML special characters in a string. * - * @param Htmlable|BackedEnum|string|int|float|null $value + * @param null|Htmlable|BackedEnum|string|int|float $value * @param bool $doubleEncode * @return string */ diff --git a/src/mail/src/Mailable/Address.php b/src/mail/src/Mailable/Address.php index 1963e52f2..171c05d32 100644 --- a/src/mail/src/Mailable/Address.php +++ b/src/mail/src/Mailable/Address.php @@ -15,7 +15,7 @@ class Address { /** * @param string $address the recipient's email address - * @param string|null $name the recipient's name + * @param null|string $name the recipient's name */ public function __construct( public string $address, diff --git a/src/mail/src/Mailable/Content.php b/src/mail/src/Mailable/Content.php index c217e5d3b..d218265d1 100644 --- a/src/mail/src/Mailable/Content.php +++ b/src/mail/src/Mailable/Content.php @@ -20,7 +20,7 @@ class Content /** * The Blade view that should be rendered for the mailable. * - * @var string|null + * @var null|string */ public $view; @@ -29,28 +29,28 @@ class Content * * Alternative syntax for "view". * - * @var string|null + * @var null|string */ public $html; /** * The Blade view that represents the text version of the message. * - * @var string|null + * @var null|string */ public $text; /** * The Blade view that represents the Markdown version of the message. * - * @var string|null + * @var null|string */ public $markdown; /** * The pre-rendered HTML of the message. * - * @var string|null + * @var null|string */ public $htmlString; @@ -64,7 +64,7 @@ class Content /** * Create a new content definition. * - * @param string|null $markdown + * @param null|string $markdown * * @named-arguments-supported */ @@ -140,7 +140,7 @@ public function htmlString(string $html) * Add a piece of view data to the message. * * @param array|string $key - * @param mixed|null $value + * @param null|mixed $value * @return $this */ public function with($key, $value = null) diff --git a/src/mail/src/Mailable/Envelope.php b/src/mail/src/Mailable/Envelope.php index dbd0eca84..5df32f272 100644 --- a/src/mail/src/Mailable/Envelope.php +++ b/src/mail/src/Mailable/Envelope.php @@ -24,7 +24,7 @@ class Envelope /** * The address sending the message. * - * @var Address|string|null + * @var null|Address|string */ public $from; @@ -59,7 +59,7 @@ class Envelope /** * The subject of the message. * - * @var string|null + * @var null|string */ public $subject; @@ -94,7 +94,7 @@ class Envelope * * @named-arguments-supported */ - public function __construct(Address|string|null $from = null, $to = [], $cc = [], $bcc = [], $replyTo = [], ?string $subject = null, array $tags = [], array $metadata = [], Closure|array $using = []) + public function __construct(null|Address|string $from = null, $to = [], $cc = [], $bcc = [], $replyTo = [], ?string $subject = null, array $tags = [], array $metadata = [], Closure|array $using = []) { $this->from = is_string($from) ? new Address($from) : $from; $this->to = $this->normalizeAddresses($to); @@ -110,7 +110,7 @@ public function __construct(Address|string|null $from = null, $to = [], $cc = [] /** * Specify who the message will be "from". * - * @param string|null $name + * @param null|string $name * @return $this */ public function from(Address|string $address, $name = null) @@ -124,7 +124,7 @@ public function from(Address|string $address, $name = null) * Add a "to" recipient to the message envelope. * * @param Address|array|string $address - * @param string|null $name + * @param null|string $name * @return $this */ public function to(Address|array|string $address, $name = null) @@ -142,7 +142,7 @@ public function to(Address|array|string $address, $name = null) * Add a "cc" recipient to the message envelope. * * @param Address|array|string $address - * @param string|null $name + * @param null|string $name * @return $this */ public function cc(Address|array|string $address, $name = null) @@ -158,7 +158,7 @@ public function cc(Address|array|string $address, $name = null) * Add a "bcc" recipient to the message envelope. * * @param Address|array|string $address - * @param string|null $name + * @param null|string $name * @return $this */ public function bcc(Address|array|string $address, $name = null) @@ -174,7 +174,7 @@ public function bcc(Address|array|string $address, $name = null) * Add a "reply to" recipient to the message envelope. * * @param Address|array|string $address - * @param string|null $name + * @param null|string $name * @return $this */ public function replyTo(Address|array|string $address, $name = null) diff --git a/src/mail/src/Mailable/Headers.php b/src/mail/src/Mailable/Headers.php index d18172bb6..a85dae8cb 100644 --- a/src/mail/src/Mailable/Headers.php +++ b/src/mail/src/Mailable/Headers.php @@ -23,7 +23,7 @@ class Headers /** * The message's message ID. * - * @var string|null + * @var null|string */ public $messageId; diff --git a/src/mail/src/Mailer.php b/src/mail/src/Mailer.php index a22be5cd2..b39087f84 100644 --- a/src/mail/src/Mailer.php +++ b/src/mail/src/Mailer.php @@ -176,7 +176,7 @@ public function render(string|array $view, array $data = []): string /** * Send a new message using a view. */ - public function send(Mailable|string|array $view, array $data = [], Closure|string|null $callback = null): ?SentMessage + public function send(Mailable|string|array $view, array $data = [], null|Closure|string $callback = null): ?SentMessage { if ($view instanceof MailableContract) { return $this->sendMailable($view); @@ -285,7 +285,7 @@ protected function sendMailable(MailableContract $mailable): ?SentMessage /** * Parse the given view name or array. */ - protected function parseView(Closure|array|string|null $view): array + protected function parseView(null|Closure|array|string $view): array { if (is_string($view) || $view instanceof Closure) { return [$view, null, null]; @@ -315,7 +315,7 @@ protected function parseView(Closure|array|string|null $view): array /** * Add the content to a given message. */ - protected function addContent(Message $message, Closure|string|null $view, Closure|string|null $plain, ?string $raw, array $data = []): void + protected function addContent(Message $message, null|Closure|string $view, null|Closure|string $plain, ?string $raw, array $data = []): void { if (isset($view)) { $message->html($this->renderView($view, $data) ?: ' '); diff --git a/src/mail/src/Message.php b/src/mail/src/Message.php index 57a978ed0..e308512d1 100644 --- a/src/mail/src/Message.php +++ b/src/mail/src/Message.php @@ -104,7 +104,7 @@ public function to(string|array $address, ?string $name = null, bool $override = */ public function forgetTo(): static { - /** @var MailboxListHeader|null $header */ + /** @var null|MailboxListHeader $header */ $header = $this->message->getHeaders()->get('To'); if ($header) { $this->addAddressDebugHeader('X-To', $this->message->getTo()); @@ -136,7 +136,7 @@ public function cc(string|array $address, ?string $name = null, bool $override = */ public function forgetCc(): static { - /** @var MailboxListHeader|null $header */ + /** @var null|MailboxListHeader $header */ $header = $this->message->getHeaders()->get('Cc'); if ($header) { $this->addAddressDebugHeader('X-Cc', $this->message->getCC()); @@ -168,7 +168,7 @@ public function bcc(string|array $address, ?string $name = null, bool $override */ public function forgetBcc(): static { - /** @var MailboxListHeader|null $header */ + /** @var null|MailboxListHeader $header */ $header = $this->message->getHeaders()->get('Bcc'); if ($header) { $this->addAddressDebugHeader('X-Bcc', $this->message->getBcc()); diff --git a/src/model-factory/src/Functions.php b/src/model-factory/src/Functions.php index 6a52d8e57..92ece3d52 100644 --- a/src/model-factory/src/Functions.php +++ b/src/model-factory/src/Functions.php @@ -19,7 +19,7 @@ use TypeError; /** - * @return FactoryBuilder|null + * @return null|FactoryBuilder * @throws TypeError * @throws NotFoundExceptionInterface * @throws ContainerExceptionInterface diff --git a/src/model-hashids/src/Concerns/HasHashid.php b/src/model-hashids/src/Concerns/HasHashid.php index 56e49d6b3..48ff18ec9 100644 --- a/src/model-hashids/src/Concerns/HasHashid.php +++ b/src/model-hashids/src/Concerns/HasHashid.php @@ -36,7 +36,7 @@ public function hashid() * Decode the hashid to the id. * * @param string $hashid - * @return int|null + * @return null|int */ public function hashidToId($hashid) { @@ -47,7 +47,7 @@ public function hashidToId($hashid) * Encode an id to its equivalent hashid. * * @param string $id - * @return string|null + * @return null|string */ public function idToHashid($id) { @@ -77,7 +77,7 @@ protected function getHashidsConnection() } /** - * @return string|null + * @return null|string */ protected function getHashidAttribute() { diff --git a/src/model-hashids/src/Concerns/HashidRouting.php b/src/model-hashids/src/Concerns/HashidRouting.php index 715b60350..d8efdeed3 100644 --- a/src/model-hashids/src/Concerns/HashidRouting.php +++ b/src/model-hashids/src/Concerns/HashidRouting.php @@ -19,7 +19,7 @@ trait HashidRouting * @see parent * @param mixed $query * @param mixed $value - * @param mixed|null $field + * @param null|mixed $field */ public function resolveRouteBindingQuery($query, $value, $field = null) { diff --git a/src/monolog-hook/src/Aspect/UdpSocketAspect.php b/src/monolog-hook/src/Aspect/UdpSocketAspect.php index 018c4a7e5..435c80e78 100644 --- a/src/monolog-hook/src/Aspect/UdpSocketAspect.php +++ b/src/monolog-hook/src/Aspect/UdpSocketAspect.php @@ -19,7 +19,7 @@ use WeakMap; /** - * @property Socket|null $socket + * @property null|Socket $socket */ class UdpSocketAspect extends AbstractAspect { diff --git a/src/notification-mail/src/Message/MailMessage.php b/src/notification-mail/src/Message/MailMessage.php index 6b6eecd1f..67eba7778 100644 --- a/src/notification-mail/src/Message/MailMessage.php +++ b/src/notification-mail/src/Message/MailMessage.php @@ -30,7 +30,7 @@ class MailMessage extends SimpleMessage implements Renderable /** * The view to be rendered. */ - public array|string|null $view = null; + public null|array|string $view = null; /** * The view data for the message. diff --git a/src/notification/src/DatabaseNotification.php b/src/notification/src/DatabaseNotification.php index f91556ca9..b606a27c9 100644 --- a/src/notification/src/DatabaseNotification.php +++ b/src/notification/src/DatabaseNotification.php @@ -17,7 +17,7 @@ use Hyperf\Database\Model\Relations\MorphTo; /** - * @property Carbon|null $read_at + * @property null|Carbon $read_at */ class DatabaseNotification extends Model { diff --git a/src/notification/src/NotificationSender.php b/src/notification/src/NotificationSender.php index 133201d6c..7ce84df68 100644 --- a/src/notification/src/NotificationSender.php +++ b/src/notification/src/NotificationSender.php @@ -24,7 +24,7 @@ use function Hyperf\Support\value; /** - * @property string|null $locale + * @property null|string $locale */ class NotificationSender { diff --git a/src/oauth2-server/src/Event/ScopeResolveEvent.php b/src/oauth2-server/src/Event/ScopeResolveEvent.php index 9a030a930..cb6fa0f00 100644 --- a/src/oauth2-server/src/Event/ScopeResolveEvent.php +++ b/src/oauth2-server/src/Event/ScopeResolveEvent.php @@ -21,7 +21,7 @@ public function __construct( private array $scopes, private readonly Grant $grant, private readonly ClientInterface $client, - private readonly string|int|null $userIdentifier + private readonly null|string|int $userIdentifier ) { } @@ -45,7 +45,7 @@ public function getClient(): ClientInterface return $this->client; } - public function getUserIdentifier(): int|string|null + public function getUserIdentifier(): null|int|string { return $this->userIdentifier; } diff --git a/src/oauth2-server/src/Model/AccessToken.php b/src/oauth2-server/src/Model/AccessToken.php index 57ea13ed7..807a61f72 100644 --- a/src/oauth2-server/src/Model/AccessToken.php +++ b/src/oauth2-server/src/Model/AccessToken.php @@ -87,7 +87,7 @@ public function getUserIdentifier(): ?string public function getClient(): ClientInterface { /** - * @var ClientInterface|null $client + * @var null|ClientInterface $client */ $client = $this->client()->first(); if ($client === null) { diff --git a/src/oauth2-server/src/Model/AuthorizationCode.php b/src/oauth2-server/src/Model/AuthorizationCode.php index af7bc21ed..ad641cf02 100644 --- a/src/oauth2-server/src/Model/AuthorizationCode.php +++ b/src/oauth2-server/src/Model/AuthorizationCode.php @@ -93,7 +93,7 @@ public function getUserIdentifier(): ?string public function getClient(): ClientInterface { /** - * @var ClientInterface|null $client + * @var null|ClientInterface $client */ $client = $this->client()->first(); if ($client === null) { diff --git a/src/oauth2-server/src/Model/Device.php b/src/oauth2-server/src/Model/Device.php index 40709ed66..bbeeee438 100644 --- a/src/oauth2-server/src/Model/Device.php +++ b/src/oauth2-server/src/Model/Device.php @@ -31,7 +31,7 @@ * @property ClientInterface $client * @property string $ip_address * @property DeviceCodeStatus $status - * @property Carbon|null $last_poll_at + * @property null|Carbon $last_poll_at * @property bool $revoke */ class Device extends Model implements DeviceCodeInterface diff --git a/src/oauth2-server/src/Repository/ScopeRepository.php b/src/oauth2-server/src/Repository/ScopeRepository.php index 7349dee21..dab43c91b 100644 --- a/src/oauth2-server/src/Repository/ScopeRepository.php +++ b/src/oauth2-server/src/Repository/ScopeRepository.php @@ -56,7 +56,7 @@ public function finalizeScopes( array $scopes, string $grantType, ClientEntityInterface $clientEntity, - string|int|null $userIdentifier = null, + null|string|int $userIdentifier = null, ?string $authCodeId = null, ): array { /** @var ClientInterface $client */ diff --git a/src/oauth2-server/src/Repository/UserRepository.php b/src/oauth2-server/src/Repository/UserRepository.php index 6ffea682a..e455f87a5 100644 --- a/src/oauth2-server/src/Repository/UserRepository.php +++ b/src/oauth2-server/src/Repository/UserRepository.php @@ -37,7 +37,7 @@ public function getUserEntityByUserCredentials( string $grantType, ClientEntityInterface $clientEntity, ): ?UserEntityInterface { - /** @var ClientInterface|null $client */ + /** @var null|ClientInterface $client */ $client = $this->clientManager->find($clientEntity->getIdentifier()); if ($client === null) { diff --git a/src/pretty-console/src/View/Components/Choice.php b/src/pretty-console/src/View/Components/Choice.php index 58f1ab9bf..41b7f822a 100644 --- a/src/pretty-console/src/View/Components/Choice.php +++ b/src/pretty-console/src/View/Components/Choice.php @@ -21,7 +21,7 @@ class Choice extends Component * @param string $question * @param array $choices * @param mixed $default - * @param mixed|null $attempts + * @param null|mixed $attempts * @param mixed $multiple * @return mixed */ diff --git a/src/pretty-console/src/View/Components/Task.php b/src/pretty-console/src/View/Components/Task.php index 3d50fd610..a861dd311 100644 --- a/src/pretty-console/src/View/Components/Task.php +++ b/src/pretty-console/src/View/Components/Task.php @@ -22,7 +22,7 @@ class Task extends Component * Renders the component using the given arguments. * * @param string $description - * @param (callable(): bool)|null $task + * @param null|(callable(): bool) $task * @param int $verbosity */ public function render($description, $task = null, $verbosity = OutputInterface::VERBOSITY_NORMAL) diff --git a/src/pretty-console/src/View/Components/TwoColumnDetail.php b/src/pretty-console/src/View/Components/TwoColumnDetail.php index f568bf881..4a2bb5b9c 100644 --- a/src/pretty-console/src/View/Components/TwoColumnDetail.php +++ b/src/pretty-console/src/View/Components/TwoColumnDetail.php @@ -19,7 +19,7 @@ class TwoColumnDetail extends Component * Renders the component using the given arguments. * * @param string $first - * @param string|null $second + * @param null|string $second * @param int $verbosity */ public function render($first, $second = null, $verbosity = OutputInterface::VERBOSITY_NORMAL) diff --git a/src/purifier/src/Casts/WithConfig.php b/src/purifier/src/Casts/WithConfig.php index 0e11a2e37..91c4eee3b 100644 --- a/src/purifier/src/Casts/WithConfig.php +++ b/src/purifier/src/Casts/WithConfig.php @@ -13,7 +13,7 @@ trait WithConfig { - public function __construct(protected array|string|null $config = null) + public function __construct(protected null|array|string $config = null) { } } diff --git a/src/purifier/src/Functions.php b/src/purifier/src/Functions.php index 91f2c32dc..b43a4f530 100644 --- a/src/purifier/src/Functions.php +++ b/src/purifier/src/Functions.php @@ -20,7 +20,7 @@ * @param T $dirty * @return ($dirty is string ? string : ($dirty is array ? array : T)) */ - function clean(mixed $dirty, array|string|null $config = null, ?Closure $postCreateConfigHook = null) + function clean(mixed $dirty, null|array|string $config = null, ?Closure $postCreateConfigHook = null) { return ApplicationContext::getContainer()->get(Purifier::class)->clean($dirty, $config, $postCreateConfigHook); } diff --git a/src/purifier/src/Purifier.php b/src/purifier/src/Purifier.php index 3074a51d5..a259a2c49 100644 --- a/src/purifier/src/Purifier.php +++ b/src/purifier/src/Purifier.php @@ -59,7 +59,7 @@ private function setUp(): void * @param T $dirty * @return ($dirty is string ? string : ($dirty is array ? array : T)) */ - public function clean(mixed $dirty, array|string|null $config = null, ?Closure $postCreateConfigHook = null): mixed + public function clean(mixed $dirty, null|array|string $config = null, ?Closure $postCreateConfigHook = null): mixed { if (is_array($dirty)) { return array_map(function ($item) use ($config) { @@ -94,7 +94,7 @@ public function getInstance(): HTMLPurifier return $this->purifier; } - protected function getConfig(array|string|null $config = null): HTMLPurifier_Config + protected function getConfig(null|array|string $config = null): HTMLPurifier_Config { // Create a new configuration object $configObject = HTMLPurifier_Config::createDefault(); @@ -153,7 +153,7 @@ protected function getConfig(array|string|null $config = null): HTMLPurifier_Con * * @see http://htmlpurifier.org/docs/enduser-customize.html * - * @param HTMLPurifier_Config|null $configObject Defaults to using default config + * @param null|HTMLPurifier_Config $configObject Defaults to using default config */ private function addCustomDefinition(array $definitionConfig, ?HTMLPurifier_Config $configObject = null): void { diff --git a/src/redis-subscriber/src/CommandBuilder.php b/src/redis-subscriber/src/CommandBuilder.php index 5ac83d81f..fa53d0f03 100644 --- a/src/redis-subscriber/src/CommandBuilder.php +++ b/src/redis-subscriber/src/CommandBuilder.php @@ -23,7 +23,7 @@ class CommandBuilder { /** - * @param int|string|array|mixed|null $args + * @param null|int|string|array|mixed $args */ public static function build(mixed $args): string { diff --git a/src/redis-subscriber/src/CommandInvoker.php b/src/redis-subscriber/src/CommandInvoker.php index 63f06af2f..f7b0de13d 100644 --- a/src/redis-subscriber/src/CommandInvoker.php +++ b/src/redis-subscriber/src/CommandInvoker.php @@ -39,7 +39,7 @@ public function __construct(protected Connection $connection, protected ?StdoutL } /** - * @param int|string|array|null $command + * @param null|int|string|array $command */ public function invoke(mixed $command, int $number): array { @@ -84,7 +84,7 @@ public function ping(float $timeout = 1): string|bool */ protected function receive(Connection $connection): void { - /** @var array|null $buffer */ + /** @var null|array $buffer */ $buffer = null; while (true) { diff --git a/src/sentry/class_map/SentrySdk.php b/src/sentry/class_map/SentrySdk.php index 69eadda27..37d47ff15 100644 --- a/src/sentry/class_map/SentrySdk.php +++ b/src/sentry/class_map/SentrySdk.php @@ -24,7 +24,7 @@ class SentrySdk { /** - * @var HubInterface|null The current hub + * @var null|HubInterface The current hub */ private static $currentHub; /** @phpstan-ignore-line */ diff --git a/src/sentry/src/Aspect/BreadcrumbAspect.php b/src/sentry/src/Aspect/BreadcrumbAspect.php index 0ea263147..061495394 100644 --- a/src/sentry/src/Aspect/BreadcrumbAspect.php +++ b/src/sentry/src/Aspect/BreadcrumbAspect.php @@ -31,7 +31,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) return tap($proceedingJoinPoint->process(), function ($result) use ($proceedingJoinPoint, $startTime) { $metadata = $proceedingJoinPoint->getAnnotationMetadata(); - /** @var BreadcrumbAnnotation|null $annotation */ + /** @var null|BreadcrumbAnnotation $annotation */ $annotation = $metadata->method[BreadcrumbAnnotation::class] ?? null; if (! $annotation) { diff --git a/src/sentry/src/Aspect/LoggerAspect.php b/src/sentry/src/Aspect/LoggerAspect.php index eca0ea0ab..e0689ea5e 100644 --- a/src/sentry/src/Aspect/LoggerAspect.php +++ b/src/sentry/src/Aspect/LoggerAspect.php @@ -47,7 +47,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) $level = $level instanceof BackedEnum ? (int) $level->value : (int) $level; $message = $proceedingJoinPoint->arguments['keys']['message']; $context = $proceedingJoinPoint->arguments['keys']['context']; - /** @var DateTimeImmutable|null $datetime */ + /** @var null|DateTimeImmutable $datetime */ $datetime = $proceedingJoinPoint->arguments['keys']['datetime']; if (isset($context['no_sentry_aspect']) && $context['no_sentry_aspect'] === true) { diff --git a/src/sentry/src/Factory/HubFactory.php b/src/sentry/src/Factory/HubFactory.php index ed0d9da12..480229104 100644 --- a/src/sentry/src/Factory/HubFactory.php +++ b/src/sentry/src/Factory/HubFactory.php @@ -23,7 +23,7 @@ use function Hyperf\Support\make; /** - * @property \Sentry\Transport\TransportInterface|null $transport + * @property null|\Sentry\Transport\TransportInterface $transport * @method \Sentry\ClientInterface getClient() */ class HubFactory diff --git a/src/sentry/src/Integration/RequestFetcher.php b/src/sentry/src/Integration/RequestFetcher.php index 7d0997de5..3cd30a641 100644 --- a/src/sentry/src/Integration/RequestFetcher.php +++ b/src/sentry/src/Integration/RequestFetcher.php @@ -19,7 +19,7 @@ class RequestFetcher implements RequestFetcherInterface { public function fetchRequest(): ?ServerRequestInterface { - /** @var ServerRequestInterface|null $request */ + /** @var null|ServerRequestInterface $request */ $request = Context::get(ServerRequestInterface::class); if (! $request || ! method_exists($request, 'withServerParams')) { diff --git a/src/sentry/src/Integration/RequestIntegration.php b/src/sentry/src/Integration/RequestIntegration.php index 7952f768c..8a3fa7f36 100644 --- a/src/sentry/src/Integration/RequestIntegration.php +++ b/src/sentry/src/Integration/RequestIntegration.php @@ -47,7 +47,7 @@ public function setupOnce(): void protected function getClientIp(): ?string { - /** @var ServerRequestInterface|null $request */ + /** @var null|ServerRequestInterface $request */ $request = Context::get(ServerRequestInterface::class); if (! $request) { diff --git a/src/sentry/src/Monolog/LogsHandler.php b/src/sentry/src/Monolog/LogsHandler.php index 374c84d65..e6b305a3f 100644 --- a/src/sentry/src/Monolog/LogsHandler.php +++ b/src/sentry/src/Monolog/LogsHandler.php @@ -23,7 +23,7 @@ class LogsHandler extends \Sentry\Monolog\LogsHandler public function __construct( protected string $group = 'default', - int|LogLevel|null $logLevel = null, + null|int|LogLevel $logLevel = null, protected bool $bubble = true ) { if (is_int($logLevel)) { diff --git a/src/sentry/src/Tracing/Aspect/AmqpProducerAspect.php b/src/sentry/src/Tracing/Aspect/AmqpProducerAspect.php index 3f195a10f..6aadd0b41 100644 --- a/src/sentry/src/Tracing/Aspect/AmqpProducerAspect.php +++ b/src/sentry/src/Tracing/Aspect/AmqpProducerAspect.php @@ -53,7 +53,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) protected function handleProduceMessage(ProceedingJoinPoint $proceedingJoinPoint) { - /** @var ProducerMessage|null $producerMessage */ + /** @var null|ProducerMessage $producerMessage */ $producerMessage = $proceedingJoinPoint->arguments['keys']['producerMessage'] ?? null; if (! $producerMessage) { @@ -75,7 +75,7 @@ protected function handleProduceMessage(ProceedingJoinPoint $proceedingJoinPoint $poolName = $producerMessage->getPoolName(); if (class_exists(AnnotationCollector::class)) { - /** @var Producer|null $annotation */ + /** @var null|Producer $annotation */ $annotation = AnnotationCollector::getClassAnnotation(get_class($producerMessage), Producer::class); if ($annotation) { $annotation->routingKey && $routingKey = $annotation->routingKey; diff --git a/src/sentry/src/Tracing/Aspect/AsyncQueueJobMessageAspect.php b/src/sentry/src/Tracing/Aspect/AsyncQueueJobMessageAspect.php index eaf9defbd..c2682623f 100644 --- a/src/sentry/src/Tracing/Aspect/AsyncQueueJobMessageAspect.php +++ b/src/sentry/src/Tracing/Aspect/AsyncQueueJobMessageAspect.php @@ -159,7 +159,7 @@ protected function handleUnserialize(ProceedingJoinPoint $proceedingJoinPoint) default => null, }; - /** @var string|null $carrier */ + /** @var null|string $carrier */ if ($carrier) { Context::set(Constants::TRACE_CARRIER, Carrier::fromJson($carrier)); } diff --git a/src/sentry/src/Tracing/Aspect/RpcAspect.php b/src/sentry/src/Tracing/Aspect/RpcAspect.php index de4a37c5d..53a6e95fa 100644 --- a/src/sentry/src/Tracing/Aspect/RpcAspect.php +++ b/src/sentry/src/Tracing/Aspect/RpcAspect.php @@ -124,7 +124,7 @@ private function handleSend(ProceedingJoinPoint $proceedingJoinPoint) // 'server.address' => '', // 'server.port' => '', - /** @var Span|null $span */ + /** @var null|Span $span */ $span = Context::get(static::SPAN); try { diff --git a/src/sentry/src/Tracing/Aspect/TraceAnnotationAspect.php b/src/sentry/src/Tracing/Aspect/TraceAnnotationAspect.php index 45a57430b..1f4f9b4ac 100644 --- a/src/sentry/src/Tracing/Aspect/TraceAnnotationAspect.php +++ b/src/sentry/src/Tracing/Aspect/TraceAnnotationAspect.php @@ -36,7 +36,7 @@ public function __construct(protected Switcher $switcher) public function process(ProceedingJoinPoint $proceedingJoinPoint) { $metadata = $proceedingJoinPoint->getAnnotationMetadata(); - /** @var Trace|null $annotation */ + /** @var null|Trace $annotation */ $annotation = $metadata->method[Trace::class] ?? null; if (! $annotation || ! $parent = SentrySdk::getCurrentHub()->getSpan()) { diff --git a/src/sentry/src/Tracing/Listener/TracingAmqpListener.php b/src/sentry/src/Tracing/Listener/TracingAmqpListener.php index 7def27e42..66801018e 100644 --- a/src/sentry/src/Tracing/Listener/TracingAmqpListener.php +++ b/src/sentry/src/Tracing/Listener/TracingAmqpListener.php @@ -69,7 +69,7 @@ protected function startTransaction(BeforeConsume $event): void if (method_exists($event, 'getAMQPMessage')) { /** @var AMQPMessage $amqpMessage */ $amqpMessage = $event->getAMQPMessage(); - /** @var AMQPTable|null $applicationHeaders */ + /** @var null|AMQPTable $applicationHeaders */ $applicationHeaders = $amqpMessage->has('application_headers') ? $amqpMessage->get('application_headers') : null; if ($applicationHeaders && isset($applicationHeaders[Constants::TRACE_CARRIER])) { $carrier = Carrier::fromJson($applicationHeaders[Constants::TRACE_CARRIER]); @@ -97,7 +97,7 @@ protected function finishTransaction(AfterConsume|FailToConsume $event): void return; } - /** @var Carrier|null $carrier */ + /** @var null|Carrier $carrier */ $carrier = Context::get(Constants::TRACE_CARRIER); /** @var ConsumerMessage $message */ diff --git a/src/sentry/src/Tracing/Listener/TracingAsyncQueueListener.php b/src/sentry/src/Tracing/Listener/TracingAsyncQueueListener.php index 127a32d96..d86fb24be 100644 --- a/src/sentry/src/Tracing/Listener/TracingAsyncQueueListener.php +++ b/src/sentry/src/Tracing/Listener/TracingAsyncQueueListener.php @@ -63,7 +63,7 @@ public function process(object $event): void protected function startTransaction(BeforeHandle $event): void { - /** @var Carrier|null $carrier */ + /** @var null|Carrier $carrier */ $carrier = Context::get(Constants::TRACE_CARRIER, null, Coroutine::parentId()); $job = $event->getMessage()->job(); @@ -88,7 +88,7 @@ protected function finishTransaction(AfterHandle|RetryHandle|FailedHandle $event return; } - /** @var Carrier|null $carrier */ + /** @var null|Carrier $carrier */ $carrier = Context::get(Constants::TRACE_CARRIER, null, Coroutine::parentId()); $data = [ 'messaging.system' => 'async_queue', diff --git a/src/sentry/src/Tracing/Listener/TracingKafkaListener.php b/src/sentry/src/Tracing/Listener/TracingKafkaListener.php index 1733de7f9..d9f09baa5 100644 --- a/src/sentry/src/Tracing/Listener/TracingKafkaListener.php +++ b/src/sentry/src/Tracing/Listener/TracingKafkaListener.php @@ -95,7 +95,7 @@ protected function finishTransaction(AfterConsume|FailToConsume $event): void return; } - /** @var Carrier|null $carrier */ + /** @var null|Carrier $carrier */ $carrier = Context::get(Constants::TRACE_CARRIER); $consumer = $event->getConsumer(); $tags = []; diff --git a/src/sentry/src/Tracing/SpanStarter.php b/src/sentry/src/Tracing/SpanStarter.php index 1bbde5083..3fd0a7396 100644 --- a/src/sentry/src/Tracing/SpanStarter.php +++ b/src/sentry/src/Tracing/SpanStarter.php @@ -65,7 +65,7 @@ protected function startRequestTransaction(ServerRequestInterface $request, ...$ // Rpc Context if ($container->has(RpcContext::class)) { $rpcContext = $container->get(RpcContext::class); - /** @var string|null $payload */ + /** @var null|string $payload */ $payload = $rpcContext->get(Constants::TRACE_CARRIER); if ($payload) { $carrier = Carrier::fromJson($payload); diff --git a/src/sentry/src/Transport/CoHttpTransport.php b/src/sentry/src/Transport/CoHttpTransport.php index a7d24b260..208575408 100644 --- a/src/sentry/src/Transport/CoHttpTransport.php +++ b/src/sentry/src/Transport/CoHttpTransport.php @@ -89,7 +89,7 @@ protected function loop(): void $logger = $this->clientBuilder?->getLogger(); while (true) { - /** @var Event|false|null $event */ + /** @var null|Event|false $event */ $event = $this->chan?->pop(); if (! $event) { diff --git a/src/sentry/src/Util/SafeCaller.php b/src/sentry/src/Util/SafeCaller.php index 6227be1d0..605733e08 100644 --- a/src/sentry/src/Util/SafeCaller.php +++ b/src/sentry/src/Util/SafeCaller.php @@ -28,7 +28,7 @@ class SafeCaller * * @param Closure(): TReturn $closure * @param TDefault $default - * @param Closure(Throwable $e):bool|null $exceptionHandler + * @param null|Closure(Throwable $e):bool $exceptionHandler * @return TReturn|TDefault */ public function call(Closure $closure, mixed $default = null, ?Closure $exceptionHandler = null): mixed diff --git a/src/support/src/Contract/HubInterface.php b/src/support/src/Contract/HubInterface.php index 2a9f53520..65c99c501 100644 --- a/src/support/src/Contract/HubInterface.php +++ b/src/support/src/Contract/HubInterface.php @@ -17,7 +17,7 @@ interface HubInterface * Send an object through one of the available pipelines. * * @param mixed $object - * @param string|null $pipeline + * @param null|string $pipeline * @return mixed */ public function pipe($object, $pipeline = null); diff --git a/src/support/src/Env.php b/src/support/src/Env.php index a50bdac94..4dac8e971 100644 --- a/src/support/src/Env.php +++ b/src/support/src/Env.php @@ -30,7 +30,7 @@ class Env /** * The environment repository instance. * - * @var \Dotenv\Repository\RepositoryInterface|null + * @var null|\Dotenv\Repository\RepositoryInterface */ protected static $repository; diff --git a/src/support/src/Functions.php b/src/support/src/Functions.php index 5656a988b..cc9f43026 100644 --- a/src/support/src/Functions.php +++ b/src/support/src/Functions.php @@ -23,7 +23,7 @@ * @param array|int $times * @param callable(int):TReturn $callback * @param Closure|int $sleepMilliseconds - * @param callable|null $when + * @param null|callable $when * @return TReturn|void * @throws Exception */ diff --git a/src/support/src/Number.php b/src/support/src/Number.php index e66a67cf3..fada198ce 100644 --- a/src/support/src/Number.php +++ b/src/support/src/Number.php @@ -72,7 +72,7 @@ public static function parseInt(string $string, ?string $locale = null): int * Parse a string into a float according to the specified locale. * * @param string $string The string to parse - * @param string|null $locale The locale to use + * @param null|string $locale The locale to use */ public static function parseFloat(string $string, ?string $locale = null): float { diff --git a/src/support/src/Once.php b/src/support/src/Once.php index e2eb19e96..005c507f7 100644 --- a/src/support/src/Once.php +++ b/src/support/src/Once.php @@ -18,7 +18,7 @@ class Once /** * The current globally used instance. * - * @var static|null + * @var null|static */ protected static ?self $instance = null; diff --git a/src/support/src/Once/Cache.php b/src/support/src/Once/Cache.php index e3b17f4a1..e44361cf0 100644 --- a/src/support/src/Once/Cache.php +++ b/src/support/src/Once/Cache.php @@ -23,7 +23,7 @@ class Cache implements Countable /** * The cache instance. - * @var static|null + * @var null|static */ protected static $cache; diff --git a/src/support/src/Onceable.php b/src/support/src/Onceable.php index 55a548ca9..46d1fb07f 100644 --- a/src/support/src/Onceable.php +++ b/src/support/src/Onceable.php @@ -32,7 +32,7 @@ public function __construct( * Tries to create a new onceable instance from the given trace. * * @param array> $trace - * @return static|null + * @return null|static */ public static function tryFromTrace(array $trace, callable $callable) { @@ -49,7 +49,7 @@ public static function tryFromTrace(array $trace, callable $callable) * Computes the object of the onceable from the given trace, if any. * * @param array> $trace - * @return object|null + * @return null|object */ protected static function objectFromTrace(array $trace) { @@ -60,7 +60,7 @@ protected static function objectFromTrace(array $trace) * Computes the hash of the onceable from the given trace. * * @param array> $trace - * @return string|null + * @return null|string */ protected static function hashFromTrace(array $trace, callable $callable) { diff --git a/src/support/src/Pipeline/Hub.php b/src/support/src/Pipeline/Hub.php index e4b94d00b..d21703741 100644 --- a/src/support/src/Pipeline/Hub.php +++ b/src/support/src/Pipeline/Hub.php @@ -51,7 +51,7 @@ public function pipeline(string $name, Closure $callback) * Send an object through one of the available pipelines. * * @param mixed $object - * @param string|null $pipeline + * @param null|string $pipeline * @return mixed */ public function pipe($object, $pipeline = null) diff --git a/src/support/src/Sleep.php b/src/support/src/Sleep.php index 0c52721f0..c062e54b3 100644 --- a/src/support/src/Sleep.php +++ b/src/support/src/Sleep.php @@ -52,7 +52,7 @@ class Sleep /** * The pending duration to sleep. * - * @var int|float|null + * @var null|int|float */ protected $pending; diff --git a/src/tcp-sender/src/PipeMessage.php b/src/tcp-sender/src/PipeMessage.php index f2bcadd3c..ffb6fe3bb 100644 --- a/src/tcp-sender/src/PipeMessage.php +++ b/src/tcp-sender/src/PipeMessage.php @@ -42,7 +42,7 @@ public function handle(): void /** * @template T * @param class-string $class - * @return T|null + * @return null|T */ private function get(string $class) { diff --git a/src/tcp-sender/src/Sender.php b/src/tcp-sender/src/Sender.php index 398c53174..ee795cb02 100644 --- a/src/tcp-sender/src/Sender.php +++ b/src/tcp-sender/src/Sender.php @@ -139,7 +139,7 @@ public function setResponse(int $fd, mixed $response): void } /** - * @return Response|ServerConnection|null + * @return null|Response|ServerConnection */ public function getResponse(int $fd): mixed { diff --git a/src/telescope-elasticsearch/src/Storage/ElasticsearchEntriesRepository.php b/src/telescope-elasticsearch/src/Storage/ElasticsearchEntriesRepository.php index 53abf8484..aee8bdeb1 100644 --- a/src/telescope-elasticsearch/src/Storage/ElasticsearchEntriesRepository.php +++ b/src/telescope-elasticsearch/src/Storage/ElasticsearchEntriesRepository.php @@ -76,7 +76,7 @@ public function find($id): EntryResult /** * Return all the entries of a given type. * - * @param string|null $type + * @param null|string $type * * @return Collection */ diff --git a/src/telescope/src/Aspect/GrpcCoreMiddlewareAspect.php b/src/telescope/src/Aspect/GrpcCoreMiddlewareAspect.php index efda6aa7a..fdf789215 100644 --- a/src/telescope/src/Aspect/GrpcCoreMiddlewareAspect.php +++ b/src/telescope/src/Aspect/GrpcCoreMiddlewareAspect.php @@ -51,7 +51,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) } /** - * @param Message|null $message + * @param null|Message $message */ protected function setRequestPayload($message) { @@ -69,7 +69,7 @@ protected function setRequestPayload($message) } /** - * @param Message|null $message + * @param null|Message $message */ protected function setResponsePayload($message) { diff --git a/src/telescope/src/Avatar.php b/src/telescope/src/Avatar.php index 2465606c1..15665c7bc 100644 --- a/src/telescope/src/Avatar.php +++ b/src/telescope/src/Avatar.php @@ -19,14 +19,14 @@ class Avatar /** * The callback that should be used to get the Telescope user avatar. * - * @var Closure|null + * @var null|Closure */ protected static $callback; /** * Get an avatar URL for an entry user. * - * @return string|null + * @return null|string */ public static function url(array $user) { @@ -53,7 +53,7 @@ public static function register(Closure $callback) * Find the custom avatar for a user. * * @param array $user - * @return string|null + * @return null|string */ protected static function resolve($user) { diff --git a/src/telescope/src/EntryResult.php b/src/telescope/src/EntryResult.php index d4eb450eb..d21b881f0 100644 --- a/src/telescope/src/EntryResult.php +++ b/src/telescope/src/EntryResult.php @@ -50,7 +50,7 @@ class EntryResult implements JsonSerializable /** * The entry's family hash. * - * @var string|null + * @var null|string */ public $familyHash; diff --git a/src/telescope/src/IncomingEntry.php b/src/telescope/src/IncomingEntry.php index 1e77ed228..df2fdbfd8 100644 --- a/src/telescope/src/IncomingEntry.php +++ b/src/telescope/src/IncomingEntry.php @@ -49,7 +49,7 @@ class IncomingEntry /** * The entry's family hash. * - * @var string|null + * @var null|string */ public $familyHash; diff --git a/src/telescope/src/Storage/EntryQueryOptions.php b/src/telescope/src/Storage/EntryQueryOptions.php index 37d76629f..fd703756b 100644 --- a/src/telescope/src/Storage/EntryQueryOptions.php +++ b/src/telescope/src/Storage/EntryQueryOptions.php @@ -19,14 +19,14 @@ class EntryQueryOptions /** * The batch ID that entries should belong to. * - * @var string|null + * @var null|string */ public $batchId; /** * The tag that must belong to retrieved entries. * - * @var string|null + * @var null|string */ public $tag; diff --git a/src/telescope/src/TelescopeContext.php b/src/telescope/src/TelescopeContext.php index a02e35040..4fb8da138 100644 --- a/src/telescope/src/TelescopeContext.php +++ b/src/telescope/src/TelescopeContext.php @@ -64,7 +64,7 @@ public static function setCachePacker(PackerInterface $packer): void */ public static function getCachePacker(): ?PackerInterface { - /** @var PackerInterface|null $packer */ + /** @var null|PackerInterface $packer */ $packer = Context::get(self::CACHE_PACKER); return $packer instanceof PackerInterface ? $packer : null; } diff --git a/src/trigger/src/Subscriber/TriggerSubscriber.php b/src/trigger/src/Subscriber/TriggerSubscriber.php index be88eade5..ed8d3329f 100644 --- a/src/trigger/src/Subscriber/TriggerSubscriber.php +++ b/src/trigger/src/Subscriber/TriggerSubscriber.php @@ -151,7 +151,7 @@ protected function loop(): void try { while (true) { while (true) { - /** @var array{0:class-string,1:string,2:array}|false|null $payload */ + /** @var null|array{0:class-string,1:string,2:array}|false $payload */ $payload = $this->chan?->pop(); if (! is_array($payload)) { diff --git a/tests/Concerns/InteractsWithContainer.php b/tests/Concerns/InteractsWithContainer.php index ddb5bfe41..3f9f9baf8 100644 --- a/tests/Concerns/InteractsWithContainer.php +++ b/tests/Concerns/InteractsWithContainer.php @@ -21,7 +21,7 @@ trait InteractsWithContainer { /** - * @var Container|null + * @var null|Container */ protected ?ContainerInterface $container = null;