Installation
Composer
Section titled “Composer”composer require yarunoka/coreThat is the whole installation. The package registers nothing, publishes no configuration, and has no bootstrapping step — every entry point is a class you construct yourself.
Resolving public holidays with yasumi
Section titled “Resolving public holidays with yasumi”A document may name a resolver instead of listing dates:
{"calendar": {"holidays": "yasumi-Japan"}}A name of the form yasumi-{Provider} is resolved by
yasumi when that library is
installed, with no resolver of your own to write:
composer require azuyalabs/yasumi{Provider} is a yasumi provider name (Japan, USA, …). Without the
library installed, such a name is simply an unregistered resolver, and a
document using it fails validation — nothing resolves silently to an
empty list.
Any other name is yours to bind. See Supplying dates at runtime.
Verifying the installation
Section titled “Verifying the installation”use Yarunoka\YrnkParser;
$document = (new YrnkParser())->parse('{ "version": "1.0", "timezone": "Asia/Tokyo", "schedules": [{"days": [25], "times": ["10:00"]}]}');
$document->timezone->getName(); // "Asia/Tokyo"count($document->schedules); // 1The Laravel bridge
Section titled “The Laravel bridge”Integration with Laravel is the job of the separate yarunoka/laravel
package rather than of this one. Its own documentation covers installing
and configuring it.