rmb32 / barnscaff
Filesystem projection for Barncept concept graphs
v1.0.0
2026-10-07 12:22 UTC
Requires
- php: ^8.5
- ext-ds: ^2.0
- php-ds/php-ds: ^2.0
- rmb32/barncept: ^1.0
Requires (Dev)
- infection/infection: ^0.35.4
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^13.3
- rector/rector: ^2.6
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-07 18:34:36 UTC
README
Part of BarnSuite.
Turn a Barncept concept graph into real folders and files — and
check that an existing folder still matches it. Use it from PHP, or from the
command line via barnscaff-cli.
Requirements
- PHP 8.5+
- The
dsextension,^2.0 rmb32/barncept
Installation
composer require rmb32/barnscaff
Command line
Install barnscaff-cli to get barnscaff:
composer require rmb32/barnscaff-cli
vendor/bin/barnscaff scaffold library Root ./generated # preview the plan
vendor/bin/barnscaff scaffold library Root ./generated --apply # write it
vendor/bin/barnscaff scan library Root ./generated # exit 0 if conformant, 1 otherwise
PHP usage
use Rmb32\Barncept\Api\Factory\ResolverFactory;
use Rmb32\Barncept\Api\Factory\SchemaFactory;
use Rmb32\Barncept\Api\ValueObject\Key\ImplementationKey;
use Rmb32\Barnscaff\Api\Factory\ScaffolderFactory;
use Rmb32\Barnscaff\Api\Factory\ScannerFactory;
$schema = new SchemaFactory()->create($data);
$instance = new ResolverFactory()->create()
->resolve($schema, ImplementationKey::new('Root'));
$scaffolder = new ScaffolderFactory()->create();
$plan = $scaffolder->plan($instance, '/path/to/project');
$scaffolder->apply($plan); // writes to disk
$report = new ScannerFactory()->create()->scan($instance, '/path/to/project');
$report->isConformant(); // true
To load a schema straight from a JSON file:
use Rmb32\Barnscaff\Api\Factory\SchemaFileLoaderFactory;
$schema = new SchemaFileLoaderFactory()->create()->load('/path/to/schema.json');
Related packages
- Barncept — defines the schemas and resolves them into the graph Barnscaff realises.
- Barnscaff CLI — the
barnscaff scaffold/barnscaff scancommands. - Barnark — architecture templates, built on Barncept and Barnscaff.
More docs
Internals · History · Known issues
License
Proprietary. See LICENSE. Copyright (c) Roger Barnfather.