Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Xml Config
symkit/metadata-bundle
cursor
symfony-bundles
service-definitions
xml-configuration
doctrine-mappings
dependency-injection
autowiring

XML service and Doctrine mapping conventions for Symfony bundles

Install
php artisan boost:add-skill symkit/metadata-bundle

Save this content to: .cursor/rules/xml-config.mdc

# XML Configuration Conventions

## When to Use XML

- XML service definitions are needed only for bundles with services beyond the bundle class itself
- With AbstractBundle, simple bundles (config + prepend only) do NOT need XML service files
- Use XML when the bundle registers services, listeners, compiler passes, etc.
- Never use YAML for service definitions (avoids yaml dependency)

## Service Definitions

- Defaults: `autowire="true" autoconfigure="true" public="false"`
- Prefix all service IDs with bundle alias: `acme_blog.service_name`
- Interface aliases for type-hinted injection
- Only make services `public` when the host app explicitly needs `$container->get()`

## Doctrine Mappings

- File naming: `{EntityName}.orm.xml`
- Table naming: always prefix with bundle alias — `acme_blog_article`
- Column naming: `snake_case` via `column` attribute for camelCase PHP properties
- Index naming: `idx_{alias}_{description}` to avoid collisions
- Full XSD schema location for IDE completion

## Example Service

```xml
<defaults autowire="true" autoconfigure="true" public="false" />

<service id="acme_blog.article_manager"
         class="Acme\BlogBundle\Service\ArticleManager">
    <argument>%acme_blog.api_key%</argument>
</service>

<service id="Acme\BlogBundle\Contract\ArticleManagerInterface"
         alias="acme_blog.article_manager" />
```

## After Every Change

Run `make quality` to validate the full pipeline.

XML Configuration Conventions

When to Use XML

  • XML service definitions are needed only for bundles with services beyond the bundle class itself
  • With AbstractBundle, simple bundles (config + prepend only) do NOT need XML service files
  • Use XML when the bundle registers services, listeners, compiler passes, etc.
  • Never use YAML for service definitions (avoids yaml dependency)

Service Definitions

  • Defaults: autowire="true" autoconfigure="true" public="false"
  • Prefix all service IDs with bundle alias: acme_blog.service_name
  • Interface aliases for type-hinted injection
  • Only make services public when the host app explicitly needs $container->get()

Doctrine Mappings

  • File naming: {EntityName}.orm.xml
  • Table naming: always prefix with bundle alias — acme_blog_article
  • Column naming: snake_case via column attribute for camelCase PHP properties
  • Index naming: idx_{alias}_{description} to avoid collisions
  • Full XSD schema location for IDE completion

Example Service

<defaults autowire="true" autoconfigure="true" public="false" />

<service id="acme_blog.article_manager"
         class="Acme\BlogBundle\Service\ArticleManager">
    <argument>%acme_blog.api_key%</argument>
</service>

<service id="Acme\BlogBundle\Contract\ArticleManagerInterface"
         alias="acme_blog.article_manager" />

After Every Change

Run make quality to validate the full pipeline.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource