SILLBEAM HANDBOOK · v0.4.0

Installation

Integrate Sillbeam into your Symfony application and configure exclusions for existing service imports.

Requirements

This guide covers Core v0.4.0. The package requires PHP ^8.4, Composer Runtime API ^2.2, nikic/php-parser ^5.7 and Symfony ^7.4 or ^8.0. Doctrine is optional.

Install with Composer

For a stable installation, use the latest published Core version.

BASH
composer require 'websign-dev/sillbeam-core:^0.3.0'

The Composer command follows the confirmed published version. The package and Flex recipe are published independently; the compatible recipe remains at version 0.2.

This command installs Core v0.3.0. The upgrade guide shows how to test the v0.4.0 source.

Register the bundle and routing

Composer installs the package; automatic setup depends on Symfony Flex and a recipe available at the configured endpoint that has actually been installed. Check the existing configuration: if bundle registration or the route import is missing, add it once as shown below. Avoid duplicate registration. The defaults need no config/packages/sillbeam.yaml.

PHP
// config/bundles.php – add to the existing array
Sillbeam\Core\SillbeamCoreBundle::class => ['all' => true],
YAML
# config/routes/sillbeam.yaml
sillbeam:
    resource: .
    type: sillbeam

The standard Symfony kernel is sufficient. SillbeamKernel is an optional convenience class.

Before the first Doctor invocation, select the optional Core adapter in the existing bin/console if Symfony boot is broken or should be avoided. Doctor itself writes nothing; without the adapter, Symfony can write its cache beforehand. The Flex recipe configures neither the adapter nor native service exclusions.

Limit service discovery

Keep the existing App service import and its current exclusions. Add src/Module/, src/Project/ and all custom discovery areas to its exclusions. Otherwise, the native Symfony import can register disabled or unassigned Modules too. Sillbeam does not remove these explicit imports and overrides; the Flex recipe does not change them either.

YAML
# config/services.yaml – extend the existing App\ import
services:
    _defaults:
        autowire: true
        autoconfigure: true

    App\:
        resource: '../src/'
        exclude:
            - '../src/DependencyInjection/'
            - '../src/Entity/'
            - '../src/Kernel.php'
            - '../src/Module/'
            - '../src/Project/'
            # Exclude custom discovery areas as well.

The application needs a Composer PSR-4 mapping such as "App\\": "src/". All PHP files begin with <?php. Review broad native routing and Doctrine imports as well: explicit imports can include inactive areas again. Rebuild production caches after changing code, routing, autoloading or activation.

Prepare bin/console for diagnostics

Recommended: in the existing bin/console, replace the Symfony Console Application import with the Core adapter. Keep the kernel, Symfony Runtime callback and bootstrap. This is an explicit application edit, not a second executable or an automatic recipe change.

PHP
use Sillbeam\Core\Console\Application;

This makes sillbeam:architecture, sillbeam:report, sillbeam:doctor, sillbeam:inspect:module and sillbeam:graph available before container boot. Other commands still use Symfony. The adapter does not repair service errors; generators require a working boot.

BASH
php bin/console sillbeam:doctor

Create your first module

BASH
php bin/console sillbeam:make:module Hello

This Core command creates only the module directory and an empty final descriptor. Controllers, services, entities and configuration remain application responsibilities. The manual descriptor below is an alternative, not a second step after the generator.

Create src/Module/Hello/HelloModule.php:

PHP
<?php

namespace App\Module\Hello;

#[\Sillbeam\Core\Module\Attribute\SillbeamModule]
final class HelloModule {}

Place regular services in the module directory and controllers with Symfony route attributes under Controller/. #[Exclude], #[When], #[WhenNot], #[AsAlias], autowiring and autoconfiguration use Symfony's native class loader. Native service configuration can override the defaults. Automatic interface aliases are created after all Sillbeam imports, and only when exactly one implementation exists.

Automatic service imports exclude Entity/, Dto/, Tests/, Fixtures/ and Migrations/, including nested directories. These service exclusions are separate from discovery, routing and mapping exclusions.

DoctrineBundle enables the mapping integration automatically. sillbeam: { doctrine: false } disables only Sillbeam's automatic mappings. Native mappings remain available.

Verify the module and its architecture

BASH
php bin/console cache:clear
php bin/console sillbeam:architecture --format=json
php bin/console debug:router

Check whether the report is complete and whether Core reports any architecture violations. Run php bin/console sillbeam:inspect:module Hello to inspect the new module. For setup problems, see Installation Doctor.

Next, see Modules to declare the direct dependencies of your domain module.