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 schedules-part column with. The core’s YrnkSchedule is one OR branch and the judgment API is per branch, so the any-composition a column (a whole schedules part — a list of branches) needs is closed inside this class. 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”array $schedules
Methods
Section titled “Methods”__construct(array $schedules)isDue(DateTimeInterface $at, DateTimeInterface $since): bool— Is there a scheduled point of any branch in the half-open interval (since, at] — the firing decision. Asks YrnkEvaluator’s hasMatchIn per branch and composes 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).
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): ?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).
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
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