Reference
Yarunoka\Laravel
Section titled “Yarunoka\Laravel”Schedule
Section titled “Schedule”final readonly class Schedule implements Illuminate\Contracts\Support\Arrayable, Illuminate\Contracts\Database\Eloquent\Castable
The wrapper the cast answers a schedule column with — one schedule of the DSL. The core’s YrnkSchedule stays exposed as a property, so everything php-core can do with a schedule stays reachable. The firing vocabulary the core deliberately lacks (isDue) lives here — convenience is the bridge’s business.
readonly, so a change is a reassignment ($routine->schedule = $new).
Properties
Section titled “Properties”YrnkSchedule $yrnkSchedule
Methods
Section titled “Methods”__construct(YrnkSchedule $yrnkSchedule)isDue(DateTimeInterface $at, DateTimeInterface $since): bool— Is there a scheduled point in the half-open interval (since, at] — the firing decision, the engine’s hasMatchIn as it is.toArray(): array— The raw form of the DSL (RawSchedule) — the model’s toArray / toJson show the stored spelling as it is.castUsing(array $arguments): string— The Castable form: casts() takes this wrapper’s class name alone.
Schedules
Section titled “Schedules”final readonly class Schedules implements Illuminate\Contracts\Support\Arrayable, Illuminate\Contracts\Database\Eloquent\Castable
The wrapper the cast answers a schedules-part column with — a list of Schedule whose firing decision composes with any. The elements are the bridge’s Schedule, not bare YrnkSchedule, so each of them carries the same vocabulary alone as it does in the list.
readonly, so a change is a reassignment ($routine->schedules = $new).
Properties
Section titled “Properties”array $schedules
Methods
Section titled “Methods”__construct(array $schedules)isDue(DateTimeInterface $at, DateTimeInterface $since): bool— Is there a scheduled point of any schedule in the half-open interval (since, at] — the firing decision, composed with any.toArray(): array— The raw form of the DSL (list) — the model’s toArray / toJson show the stored spelling as it is. castUsing(array $arguments): string— The Castable form: casts() takes this wrapper’s class name alone.
YarunokaServiceProvider
Section titled “YarunokaServiceProvider”class YarunokaServiceProvider extends Illuminate\Support\ServiceProvider
The Laravel integration of Yarunoka. Binds YrnkEvaluator / YrnkParser into the container, built from the config (timezone / calendar / resolvers) as the environment.
The bindings are scoped (per request) + If. Scoped, so the freshness of what the resolvers answered rides on the DI scope; If, so a binding the app makes itself always wins. The three date-set layers take an app binding of the layer interface as an override of the config key. The config is read when the environment is first derived within a scope, not at registration — reading it in register() would run ahead of later providers and of a test setting the config.
Methods
Section titled “Methods”register(): voidboot(): void
Yarunoka\Laravel\Casts
Section titled “Yarunoka\Laravel\Casts”AsYrnk
Section titled “AsYrnk”final class AsYrnk implements Illuminate\Contracts\Database\Eloquent\CastsAttributes, Illuminate\Contracts\Database\Eloquent\ComparesCastableAttributes
The Eloquent cast of a whole-document column (the JSON of a Yrnk document), for storing a timezone / calendar per row. get answers a bare Yrnk — a whole-document column stores “such a document” and grows no judgment conveniences. Whoever wants to judge builds a YrnkEvaluator from the document’s calendar / timezone.
Methods
Section titled “Methods”get(Model $model, string $key, mixed $value, array $attributes): ?Yrnkset(Model $model, string $key, mixed $value, array $attributes): ?stringcompare(Model $model, string $key, mixed $firstValue, mixed $secondValue): bool— JSON varies in key order and whitespace as a string, so the decoded arrays are compared to avoid a false dirty (a pointless UPDATE).
AsYrnkSchedule
Section titled “AsYrnkSchedule”final class AsYrnkSchedule implements Illuminate\Contracts\Database\Eloquent\CastsAttributes, Illuminate\Contracts\Database\Eloquent\ComparesCastableAttributes
The Eloquent cast of a schedule column (the JSON of one RawSchedule). The consumer writes Schedule::class (Castable) in casts() and this class is an implementation detail. ScheduleCodec is pulled from the container per call because a cast is constructed with a bare new where DI cannot reach (this also keeps the scope fresh).
Methods
Section titled “Methods”get(Model $model, string $key, mixed $value, array $attributes): ?Scheduleset(Model $model, string $key, mixed $value, array $attributes): ?stringcompare(Model $model, string $key, mixed $firstValue, mixed $secondValue): bool— JSON varies in key order and whitespace as a string, so the decoded arrays are compared to avoid a false dirty (a pointless UPDATE).
AsYrnkSchedules
Section titled “AsYrnkSchedules”final class AsYrnkSchedules implements Illuminate\Contracts\Database\Eloquent\CastsAttributes, Illuminate\Contracts\Database\Eloquent\ComparesCastableAttributes
The Eloquent cast of a schedules-part column (the JSON of a listnew where DI cannot reach (this also keeps the scope fresh).
Methods
Section titled “Methods”get(Model $model, string $key, mixed $value, array $attributes): ?Schedulesset(Model $model, string $key, mixed $value, array $attributes): ?stringcompare(Model $model, string $key, mixed $firstValue, mixed $secondValue): bool— JSON varies in key order and whitespace as a string, so the decoded arrays are compared to avoid a false dirty (a pointless UPDATE).
Yarunoka\Laravel\Exceptions
Section titled “Yarunoka\Laravel\Exceptions”InvalidYrnkColumnException
Section titled “InvalidYrnkColumnException”class InvalidYrnkColumnException extends RuntimeException implements Yarunoka\Exceptions\ExceptionInterface
The data a column held cannot be read as Yrnk. The cast’s get runs in the middle of model retrieval or serialization — a place where the cause is hard to see — so the message names the model and the column.
Yarunoka\Laravel\Rules
Section titled “Yarunoka\Laravel\Rules”ValidYrnk
Section titled “ValidYrnk”class ValidYrnk implements Illuminate\Contracts\Validation\ValidationRule
The validation rule of a whole document (a Yrnk document). Tries the construction with YrnkParser (carrying the config’s resolvers) and puts the engine’s message on the validation error as it is.
Methods
Section titled “Methods”validate(string $attribute, mixed $value, Closure $fail): void
ValidYrnkSchedule
Section titled “ValidYrnkSchedule”class ValidYrnkSchedule implements Illuminate\Contracts\Validation\ValidationRule
The validation rule of one schedule. Tries the construction with ScheduleCodec (structure + references against the config environment) and puts the engine’s message on the validation error as it is. Not a second system beside the JSON Schema — the implementation is the authority.
Methods
Section titled “Methods”validate(string $attribute, mixed $value, Closure $fail): void
ValidYrnkSchedules
Section titled “ValidYrnkSchedules”class ValidYrnkSchedules implements Illuminate\Contracts\Validation\ValidationRule
The validation rule of a schedules part. Tries the construction with ScheduleCodec (structure + references against the config environment) and puts the engine’s message on the validation error as it is. Not a second system beside the JSON Schema — the implementation is the authority.
Methods
Section titled “Methods”validate(string $attribute, mixed $value, Closure $fail): void