Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
01fdad5
Correct authentication and collection type descriptions
binaryfire Oct 26, 2026
841624c
Correct callback, resource and request annotations
binaryfire Oct 26, 2026
41d16a0
Align nullable mail settings and remaining type descriptions
binaryfire Oct 26, 2026
a5b5103
Remove unreachable basic authentication returns
binaryfire Oct 26, 2026
411a9ed
Preserve pivot types in relationship results
binaryfire Oct 26, 2026
3b232bc
Accept model subtype collections in relationship predicates
binaryfire Oct 26, 2026
c2cc115
Track component variable types and render deferred scalar values
binaryfire Oct 26, 2026
eed9e51
Accept stringable conditional validation rules
binaryfire Oct 26, 2026
418d252
Accept nullable remember tokens and passwordless generic users
binaryfire Oct 26, 2026
ebf82cd
Remove duplicate assertions and unused Blade test helpers
binaryfire Oct 26, 2026
9829cf5
Ignore explicit null eager-loading callbacks
binaryfire Oct 26, 2026
c4dad6f
Verify payload callbacks register without resolving a queue
binaryfire Oct 26, 2026
618a34d
Include single-server scheduling in JSON output
binaryfire Oct 26, 2026
7ef5169
Skip regular expressions for simple string prefixes and suffixes
binaryfire Oct 26, 2026
8a8efa1
Avoid building an eager-load query for an empty relation list
binaryfire Oct 26, 2026
1e2e99f
Serialize HTML string casts as strings
binaryfire Oct 26, 2026
327dabc
Recognize PgBouncer SSL EOF connection failures
binaryfire Oct 26, 2026
acc1144
Keep the final endpoint when building number pairs
binaryfire Oct 26, 2026
cd80f3c
Throw the intended exception for missing context stacks
binaryfire Oct 26, 2026
1e8d745
Cover floating-point values in unique rule constraints
binaryfire Oct 26, 2026
148f913
Verify simple pagination resolves its configured page name
binaryfire Oct 26, 2026
841ce7d
Ignore non-string validation error bag names
binaryfire Oct 26, 2026
b33d114
Match model parameters to the Eloquent cast contract
binaryfire Oct 26, 2026
dcb4778
Exercise message matching in the unrelated EOF test
binaryfire Oct 26, 2026
9df34d1
Coordinate the retry after the competing transaction commits
binaryfire Oct 26, 2026
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 src/auth/src/Authenticatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getRememberToken(): ?string
/**
* Set the token value for the "remember me" session.
*/
public function setRememberToken(string $value): void
public function setRememberToken(?string $value): void
{
if (! empty($this->getRememberTokenName())) {
$this->{$this->getRememberTokenName()} = $value;
Expand Down
4 changes: 2 additions & 2 deletions src/auth/src/GenericUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function getAuthPasswordName(): string
*/
public function getAuthPassword(): ?string
{
return $this->attributes[$this->getAuthPasswordName()];
return $this->attributes[$this->getAuthPasswordName()] ?? null;
}

/**
Expand All @@ -59,7 +59,7 @@ public function getRememberToken(): ?string
/**
* Set the "remember me" token value.
*/
public function setRememberToken(string $value): void
public function setRememberToken(?string $value): void
{
$this->attributes[$this->getRememberTokenName()] = $value;
}
Expand Down
7 changes: 4 additions & 3 deletions src/auth/src/Notifications/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Hypervel\Container\Container;
use Hypervel\Context\CoroutineContext;
use Hypervel\Contracts\Config\Repository as ConfigContract;
use Hypervel\Contracts\Mail\Mailable;
use Hypervel\Notifications\Messages\MailMessage;
use Hypervel\Notifications\Notification;
use Hypervel\Support\Facades\Lang;
Expand All @@ -29,7 +30,7 @@ class ResetPassword extends Notification
/**
* The callback that should be used to build the mail message.
*
* @var null|(Closure(mixed, string): MailMessage)
* @var null|(Closure(mixed, string): (Mailable|MailMessage))
*/
public static ?Closure $toMailCallback = null;

Expand Down Expand Up @@ -59,7 +60,7 @@ public function via(mixed $notifiable): array
/**
* Build the mail representation of the notification.
*/
public function toMail(mixed $notifiable): MailMessage
public function toMail(mixed $notifiable): MailMessage|Mailable
{
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
Expand Down Expand Up @@ -132,7 +133,7 @@ public static function createUrlUsing(Closure $callback): void
* Boot-only. The callback persists in a static property for the worker
* lifetime and runs on every reset-password notification.
*
* @param Closure(mixed, string): MailMessage $callback
* @param Closure(mixed, string): (Mailable|MailMessage) $callback
*/
public static function toMailUsing(Closure $callback): void
{
Expand Down
7 changes: 4 additions & 3 deletions src/auth/src/Notifications/VerifyEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Hypervel\Auth\Notifications;

use Closure;
use Hypervel\Contracts\Mail\Mailable;
use Hypervel\Notifications\Messages\MailMessage;
use Hypervel\Notifications\Notification;
use Hypervel\Support\CarbonImmutable;
Expand All @@ -24,7 +25,7 @@ class VerifyEmail extends Notification
/**
* The callback that should be used to build the mail message.
*
* @var null|(Closure(mixed, string): MailMessage)
* @var null|(Closure(mixed, string): (Mailable|MailMessage))
*/
public static ?Closure $toMailCallback = null;

Expand All @@ -39,7 +40,7 @@ public function via(mixed $notifiable): array
/**
* Build the mail representation of the notification.
*/
public function toMail(mixed $notifiable): MailMessage
public function toMail(mixed $notifiable): MailMessage|Mailable
{
$verificationUrl = $this->verificationUrl($notifiable);

Expand Down Expand Up @@ -100,7 +101,7 @@ public static function createUrlUsing(Closure $callback): void
* Boot-only. The callback persists in a static property for the worker
* lifetime and runs on every email-verification notification.
*
* @param Closure(mixed, string): MailMessage $callback
* @param Closure(mixed, string): (Mailable|MailMessage) $callback
*/
public static function toMailUsing(Closure $callback): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/auth/src/SessionGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function basic(string $field = 'email', array $extraConditions = []): ?Re
return null;
}

return $this->failedBasicResponse();
$this->failedBasicResponse();
}

/**
Expand All @@ -328,7 +328,7 @@ public function onceBasic(string $field = 'email', array $extraConditions = []):
$credentials = $this->basicCredentials($this->getRequest(), $field);

if (! $this->once(array_merge($credentials, $extraConditions))) {
return $this->failedBasicResponse();
$this->failedBasicResponse();
}

return null;
Expand Down
2 changes: 2 additions & 0 deletions src/broadcasting/src/AnonymousEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public function broadcastWith(): array

/**
* Get the channels the event should broadcast on.
*
* @return Channel|Channel[]|string[]
*/
public function broadcastOn(): Channel|array
{
Expand Down
2 changes: 1 addition & 1 deletion src/collections/src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ public function hasSole(callable|string|null $key = null, mixed $operator = null
/**
* Get the first item in the collection but throw an exception if no matching items exist.
*
* @param (callable(TValue, TKey): bool)|string $key
* @param null|(callable(TValue, TKey): bool)|string $key
* @return TValue
*
* @throws ItemNotFoundException
Expand Down
5 changes: 3 additions & 2 deletions src/collections/src/Enumerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public function nth(int $step, int $offset = 0): static;
/**
* Get the items with the specified keys.
*
* @param array<array-key, TKey>|Enumerable<array-key, TKey>|string $keys
* @param null|array<array-key, TKey>|Enumerable<array-key, TKey>|string $keys
*/
public function only(mixed $keys): static;

Expand Down Expand Up @@ -1034,7 +1034,8 @@ public function pipeThrough(array $pipes): mixed;
/**
* Get the values of a given key.
*
* @param array<array-key, string>|string $value
* @param null|array<array-key, string>|Closure|int|string $value
* @param null|array<array-key, string>|Closure|int|string $key
* @return static<array-key, mixed>
*/
public function pluck(Closure|string|int|array|null $value, Closure|string|int|array|null $key = null): Collection|static;
Expand Down
5 changes: 5 additions & 0 deletions src/collections/src/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ public function last(?callable $callback = null, mixed $default = null): mixed
* Get the values of a given key.
*
* @param null|array<array-key, string>|Closure|int|string $value
* @param null|array<array-key, string>|Closure|int|string $key
* @return static<array-key, mixed>
*/
public function pluck(Closure|string|int|array|null $value, Closure|string|int|array|null $key = null): static
Expand Down Expand Up @@ -1909,6 +1910,10 @@ protected function makeIterator(IteratorAggregate|Iterator|array|callable $sourc

/**
* Explode the "value" and "key" arguments passed to "pluck".
*
* @param null|array<array-key, string>|Closure|int|string $value
* @param null|array<array-key, string>|Closure|int|string $key
* @return array{null|array<array-key, string>|Closure|int, null|array<array-key, string>|Closure|int}
*/
protected function explodePluckParameters(Closure|string|int|array|null $value, Closure|string|int|array|null $key): array
{
Expand Down
1 change: 1 addition & 0 deletions src/console/src/Commands/ScheduleListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ protected function displayJson(Collection $events, DateTimeZone $timezone): void
'has_mutex' => $event->mutex->exists($event),
'repeat_seconds' => $event->isRepeatable() ? $event->repeatSeconds : null,
'environments' => $event->environments,
'on_one_server' => $event->onOneServer,
];
})->values()->toJson(), OutputInterface::OUTPUT_RAW);
}
Expand Down
2 changes: 1 addition & 1 deletion src/container/src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class Container implements ContainerContract
/**
* The callback used to determine the container's environment.
*
* @var null|(callable(array<int, string>|string): bool|string)
* @var null|(callable(array<int, string>|string): (bool|string))
*/
protected $environmentResolver;

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/src/Auth/Authenticatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getRememberToken(): ?string;
/**
* Set the token value for the "remember me" session.
*/
public function setRememberToken(string $value): void;
public function setRememberToken(?string $value): void;

/**
* Get the column name for the "remember me" token.
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/src/Mail/Mailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function to(array|object|string $address, ?string $name = null): static;
*
* @return $this
*/
public function locale(string $locale): static;
public function locale(?string $locale): static;

/**
* Set the name of the mailer that should be used to send the message.
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/src/Support/DeferringDisplayableValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ interface DeferringDisplayableValue
/**
* Resolve the displayable value that the class is deferring.
*/
public function resolveDisplayableValue(): Htmlable|string;
public function resolveDisplayableValue(): mixed;
}
2 changes: 1 addition & 1 deletion src/database/src/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ public function with(array|string $relations, Closure|string|null $callback = nu
if ($callback instanceof Closure) {
$eagerLoad = $this->parseWithRelations([$relations => $callback]);
} else {
$eagerLoad = $this->parseWithRelations(is_string($relations) ? func_get_args() : $relations);
$eagerLoad = $this->parseWithRelations(is_string($relations) ? array_filter(func_get_args()) : $relations);
}

$this->eagerLoad = array_merge($this->eagerLoad, $eagerLoad);
Expand Down
5 changes: 3 additions & 2 deletions src/database/src/Eloquent/Casts/AsBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Hypervel\Contracts\Database\Eloquent\Castable;
use Hypervel\Contracts\Database\Eloquent\CastsAttributes;
use Hypervel\Database\Eloquent\Model;
use Hypervel\Support\BinaryCodec;
use InvalidArgumentException;

Expand Down Expand Up @@ -43,7 +44,7 @@ public function __construct(protected array $arguments)
/**
* Transform the attribute from the underlying model values.
*/
public function get(mixed $model, string $key, mixed $value, array $attributes): ?string
public function get(Model $model, string $key, mixed $value, array $attributes): ?string
{
$attribute = $attributes[$key] ?? null;

Expand All @@ -61,7 +62,7 @@ public function get(mixed $model, string $key, mixed $value, array $attributes):
/**
* Transform the attribute to its underlying model values.
*/
public function set(mixed $model, string $key, mixed $value, array $attributes): array
public function set(Model $model, string $key, mixed $value, array $attributes): array
{
return [$key => BinaryCodec::encode($value, $this->format)];
}
Expand Down
22 changes: 19 additions & 3 deletions src/database/src/Eloquent/Casts/AsHtmlString.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use Hypervel\Contracts\Database\Eloquent\Castable;
use Hypervel\Contracts\Database\Eloquent\CastsAttributes;
use Hypervel\Contracts\Database\Eloquent\SerializesCastableAttributes;
use Hypervel\Database\Eloquent\Model;
use Hypervel\Support\HtmlString;

class AsHtmlString implements Castable
Expand All @@ -17,13 +19,27 @@ class AsHtmlString implements Castable
*/
public static function castUsing(array $arguments): CastsAttributes
{
return new class implements CastsAttributes {
public function get(mixed $model, string $key, mixed $value, array $attributes): ?HtmlString
return new class implements CastsAttributes, SerializesCastableAttributes {
/**
* Cast the stored value to an HTML string.
*/
public function get(Model $model, string $key, mixed $value, array $attributes): ?HtmlString
{
return isset($value) ? new HtmlString($value) : null;
}

public function set(mixed $model, string $key, mixed $value, array $attributes): ?string
/**
* Prepare the HTML string for storage.
*/
public function set(Model $model, string $key, mixed $value, array $attributes): ?string
{
return isset($value) ? (string) $value : null;
}

/**
* Serialize the HTML string for an array or JSON response.
*/
public function serialize(Model $model, string $key, mixed $value, array $attributes): ?string
{
return isset($value) ? (string) $value : null;
}
Expand Down
11 changes: 9 additions & 2 deletions src/database/src/Eloquent/Casts/AsStringable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Hypervel\Contracts\Database\Eloquent\Castable;
use Hypervel\Contracts\Database\Eloquent\CastsAttributes;
use Hypervel\Database\Eloquent\Model;
use Hypervel\Support\Stringable;
use Stringable as BaseStringable;

Expand All @@ -19,12 +20,18 @@ class AsStringable implements Castable
public static function castUsing(array $arguments): CastsAttributes
{
return new class implements CastsAttributes {
public function get(mixed $model, string $key, mixed $value, array $attributes): ?Stringable
/**
* Cast the stored value to a stringable instance.
*/
public function get(Model $model, string $key, mixed $value, array $attributes): ?Stringable
{
return isset($value) ? new Stringable($value) : null;
}

public function set(mixed $model, string $key, mixed $value, array $attributes): ?string
/**
* Prepare the stringable value for storage.
*/
public function set(Model $model, string $key, mixed $value, array $attributes): ?string
{
return isset($value) ? (string) $value : null;
}
Expand Down
11 changes: 9 additions & 2 deletions src/database/src/Eloquent/Casts/AsUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Hypervel\Contracts\Database\Eloquent\Castable;
use Hypervel\Contracts\Database\Eloquent\CastsAttributes;
use Hypervel\Database\Eloquent\Model;
use Hypervel\Support\Uri;

class AsUri implements Castable
Expand All @@ -18,12 +19,18 @@ class AsUri implements Castable
public static function castUsing(array $arguments): CastsAttributes
{
return new class implements CastsAttributes {
public function get(mixed $model, string $key, mixed $value, array $attributes): ?Uri
/**
* Cast the stored value to a URI.
*/
public function get(Model $model, string $key, mixed $value, array $attributes): ?Uri
{
return isset($value) ? new Uri($value) : null;
}

public function set(mixed $model, string $key, mixed $value, array $attributes): ?string
/**
* Prepare the URI for storage.
*/
public function set(Model $model, string $key, mixed $value, array $attributes): ?string
{
return isset($value) ? (string) $value : null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/database/src/Eloquent/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function loadMissing(array|string $relations): static
$relations = func_get_args();
}

if ($this->isNotEmpty()) {
if ($this->isNotEmpty() && $relations !== []) {
$query = $this->first()->newQueryWithoutRelationships()->with($relations);

foreach ($query->getEagerLoads() as $key => $value) {
Expand Down
8 changes: 6 additions & 2 deletions src/database/src/Eloquent/Concerns/QueriesRelationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ protected function getMorphTypeForQuery(string $model): string
/**
* Add a "belongs to" relationship where clause to the query.
*
* @param EloquentCollection<int, Model>|Model $related
* @param EloquentCollection<int, covariant Model>|Model $related
*
* @throws InvalidArgumentException
* @throws RelationNotFoundException
Expand Down Expand Up @@ -743,6 +743,8 @@ public function whereBelongsTo(mixed $related, ?string $relationshipName = null,

/**
* Add a "BelongsTo" relationship with an "or where" clause to the query.
*
* @param EloquentCollection<int, covariant Model>|Model $related
*/
public function orWhereBelongsTo(mixed $related, ?string $relationshipName = null): static
{
Expand All @@ -752,7 +754,7 @@ public function orWhereBelongsTo(mixed $related, ?string $relationshipName = nul
/**
* Add a "belongs to many" relationship where clause to the query.
*
* @param EloquentCollection<int, Model>|Model $related
* @param EloquentCollection<int, covariant Model>|Model $related
*
* @throws InvalidArgumentException
* @throws RelationNotFoundException
Expand Down Expand Up @@ -793,6 +795,8 @@ public function whereAttachedTo(mixed $related, ?string $relationshipName = null
/**
* Add a "belongs to many" relationship with an "or where" clause to the query.
*
* @param EloquentCollection<int, covariant Model>|Model $related
*
* @throws RuntimeException
*/
public function orWhereAttachedTo(mixed $related, ?string $relationshipName = null): static
Expand Down
Loading
Loading