Search by

friendsofmago / mago-symfony

alfredbez

Symfony support for the Mago static analyzer.

Package info

github.com/FriendsOfMago/mago-symfony

pkg:composer/friendsofmago/mago-symfony

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-12-03 14:03 UTC

This package is auto-updated.

Last update: 2026-12-03 14:39:09 UTC


README

ci Packagist version Packagist downloads PHP Mago Symfony License CodSpeed

Symfony static analysis extension for Mago. It resolves types and reports Symfony-specific mistakes across the container, config builders, console commands, lifecycle hooks, and HTTP, Form, Serializer, Messenger, and Security APIs.

Documentation: https://friendsofmago.github.io/mago-symfony/

Installation

Requires PHP 8.1 or newer with ext-tokenizer, Mago ^1.60.2, and Symfony ^6.4 || ^7.0. Compiled XML container dumps also require ext-dom, ext-libxml, and ext-xmlreader.

composer require --dev friendsofmago/mago-symfony

Register the worker in mago.toml:

[source]
includes = ["vendor/symfony", "vendor/psr"]

[extension-hosts.symfony]
command = ["php", "-d", "xdebug.mode=off", "-d", "pcov.enabled=0", "-d", "memory_limit=512M", "vendor/friendsofmago/mago-symfony/resources/worker.php"]
workers = 1
# Optional. Configure container dumps, strict service checks, or a Security user class.
# environment = {
#     MAGO_SYMFONY_CONTAINER_XML = "var/cache/dev/App_KernelDevDebugContainer.xml",
#     MAGO_SYMFONY_USER_CLASS = "App\\Entity\\User",
#     MAGO_SYMFONY_STRICT_CONTAINER_SERVICES = "1",
# }

Validate the worker and run the analyzer:

vendor/bin/mago extension validate
vendor/bin/mago analyze

Documentation

License

MIT. See LICENSE.