cognesy / instructor-dynamic
Lightweight dynamic structure record and schema builder for Instructor
v2.3.1
2026-03-30 09:17 UTC
Requires
- php: ^8.3
- cognesy/instructor: ^1.22
- cognesy/instructor-schema: ^2.3
- symfony/type-info: ^7.3 || ^8.0
Requires (Dev)
- pestphp/pest: ^4.0
- phpstan/phpstan: ^1.11
- vimeo/psalm: ^6.0
- dev-main
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.22.0
- v1.21.0
- v1.20.0
- v1.19.0
- v1.18.4
- v1.18.3
- v1.18.2
- v1.18.1
- v1.18.0
- v1.17.0
- v1.16.0
- v1.15.0
- v1.14.0
- v1.13.0
- v1.12.0
- v1.11.0
- v1.10.3
- v1.10.2
- v1.10.1
- v1.10.0
- v1.9.1
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- v1.0.0-RC22
This package is auto-updated.
Last update: 2026-03-30 11:41:25 UTC
README
Lightweight runtime structures for schema-driven inputs and outputs.
use Cognesy\Dynamic\Structure; use Cognesy\Schema\SchemaBuilder; $schema = SchemaBuilder::define('search_args') ->string('query') ->int('limit', required: false) ->schema(); $args = Structure::fromSchema($schema, ['query' => 'laravel']); $updated = $args->set('limit', 10); $updated->validate()->isValid(); // true $updated->toArray(); // ['query' => 'laravel', 'limit' => 10]
Use this package when you need:
- a small immutable runtime record (
Structure) - schema-driven structures from callables/classes (
StructureFactory)
Schema authoring lives in Cognesy\Schema (SchemaBuilder, SchemaFactory, CallableSchemaFactory).
See CHEATSHEET.md for API details.