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
Algebra Symfony

Algebra Symfony Laravel Package

nalabdou/algebra-symfony

Symfony integration for the Algebra PHP library, providing bundle configuration, dependency injection, and framework-ready wiring so you can use algebraic expressions and structures cleanly in Symfony applications.

View on GitHub
Deep Wiki
Context7

Symfony 7 bundle for algebra-php DI integration, Doctrine adapter.

Frequently asked questions about Algebra Symfony
How do I install nalabdou/algebra-symfony in a Symfony 7 application?
Install it with Composer by running composer require nalabdou/algebra-symfony. If you use Symfony Flex the bundle is normally registered automatically; without Flex you add the bundle class to config/bundles.php yourself. Afterwards, check the repository README for the configuration keys you need to add under config/packages.
Do I have to register the bundle manually in config/bundles.php?
With Symfony Flex the bundle is usually enabled for you during composer require. In a non-Flex setup, or if the recipe was skipped, add the bundle to the bundles array in config/bundles.php for every environment where you need it. If you register it only in dev and test, the dependency injection wiring will not exist in production.
How do I configure the algebra-symfony bundle?
Configuration is provided through YAML under config/packages, typically in a file named after the bundle. The available keys and their defaults are documented in the README, so copy them and adjust per environment. Because this is a DI integration bundle, most options simply become container parameters and service arguments.
What does the Doctrine adapter in this bundle actually do?
The package ships a Doctrine adapter so algebra-php expressions and structures can be used alongside Doctrine in a Symfony app. It is wired through the bundle's service definitions, so enabling the bundle is typically all that is required. Refer to the README for the exact service ids and any DBAL type or expression registration you must add.
Can I autowire algebra-php services into my own controllers and services?
Yes. Dependency injection integration is the main purpose of the bundle, so its services live in the container and can be injected through constructor autowiring. Inject the interfaces or classes named in the README instead of instantiating them with new. That keeps your classes testable and lets you swap implementations later.
What are algebra-php expressions and structures useful for in a real project?
algebra-php lets you model formulas and evaluate them at runtime instead of hard-coding calculations. Common cases are pricing and discount rules, scoring, unit conversions, and any domain where formulas change often. The Symfony bundle does not alter that behaviour; it only makes the objects available through the container.
Which Symfony versions does this bundle support?
The package targets Symfony 7, and the require section of its composer.json is the authoritative constraint. If your project is on Symfony 6.x or 5.4 you will probably need a different version or a Composer flag, and all constraints must resolve together. Check the requirements before planning a framework upgrade.
How do I test code that depends on this bundle?
Boot the kernel in a functional test with the bundle enabled, then pull the service from the test container and assert on its behaviour. For pure unit tests of your own classes, mock or stub the algebra-php interfaces so the container is not needed. Avoid container lookups in unit tests where a plain object will do.
Is nalabdou/algebra-symfony safe to use in production?
Check the repository's release tags, commit activity, and open issues before adopting it, since a small integration bundle is often maintained by a single author. Pin a specific version in composer.json and run composer audit in CI. The integration surface is thin, so if maintenance stalls you can replace the bundle with a handful of service definitions of your own.
Are there alternatives to installing this bundle?
You can require algebra-php directly and register the services you need in config/services.yaml, which removes one dependency from the chain. Other options are a small compiler pass or a different formula and expression library. The bundle mainly saves you that wiring and provides the Doctrine adapter out of the box.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections