Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/amqp-job/src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/cache/src/Contract/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
*/
Expand Down
8 changes: 4 additions & 4 deletions src/cache/src/Facade/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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)
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/cache/src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/command-signals/src/SignalRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/command-signals/src/Traits/InteractsWithSignals.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/compoships/src/Database/Eloquent/Relations/HasOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/config-consul/src/KV.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/exception-event/src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/facade/src/AsyncQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/**
* @mixin DriverFactory
* @property string|null $queue
* @property null|string $queue
*/
class AsyncQueue extends Facade
{
Expand Down
2 changes: 1 addition & 1 deletion src/facade/src/Kafka.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/**
* @mixin ProducerManager
* @property string|null $queue
* @property null|string $queue
*/
class Kafka extends Facade
{
Expand Down
2 changes: 1 addition & 1 deletion src/grpc-validation/src/Annotation/ValidationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
20 changes: 10 additions & 10 deletions src/helpers/src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
*
* @return ($abstract is callable ? Closure : ($abstract is class-string<TClass> ? 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);
Expand Down Expand Up @@ -161,7 +161,7 @@ function class_namespace($class): string
*
* @template TClass
*
* @param class-string<TClass>|string|null $abstract
* @param null|class-string<TClass>|string $abstract
*
* @return ($abstract is null ? ContainerInterface : ($abstract is class-string<TClass> ? TClass : mixed))
*/
Expand Down Expand Up @@ -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)
Expand All @@ -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
*/
Expand All @@ -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)
*/
Expand Down Expand Up @@ -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))
*/
Expand All @@ -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
*/
Expand Down Expand Up @@ -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)
Expand All @@ -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))
*/
Expand All @@ -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
*/
Expand Down
8 changes: 4 additions & 4 deletions src/http-client/src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Factory
/**
* The event dispatcher implementation.
*
* @var EventDispatcherInterface|null
* @var null|EventDispatcherInterface
*/
protected $dispatcher;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -461,7 +461,7 @@ public function recorded($callback = null)
/**
* Get the current event dispatcher implementation.
*
* @return EventDispatcherInterface|null
* @return null|EventDispatcherInterface
*/
public function getDispatcher()
{
Expand Down
Loading