phil / survey-bundle
Run surveys that adapt to each answer: conditional sections, ranking and matrix questions, cross quotas, anonymous by default, results shown above a threshold.
Package info
github.com/parler-haut-interagir-librement/survey-bundle
Type:symfony-bundle
pkg:composer/phil/survey-bundle
Requires
- php: >=8.5
- ext-mbstring: *
- ext-sodium: *
- doctrine/dbal: ^4.5
- phil/form-logic: ^0.1@dev
- phil/forms-bundle: ^0.2@dev
- phil/import-wizard: ^0.1@dev
- phil/poll: ^0.1@dev
- phil/url: ^0.1@dev
- psr/clock: ^1.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/http-foundation: ^8.2
- symfony/http-kernel: ^8.2
- symfony/routing: ^8.2
- symfony/security-csrf: ^8.2
- symfony/uid: ^8.2
- twig/html-extra: ^3.31.1
- twig/twig: ^3.31.1
Requires (Dev)
- doctrine/doctrine-bundle: ^3.3
- doctrine/orm: ^3.7
- phil/privacy-bundle: ^0.3@dev
- phpunit/phpunit: ^13.4
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
- symfony/browser-kit: ^8.2
- symfony/cache: ^8.2
- symfony/cache-contracts: ^3.6
- symfony/clock: ^8.2
- symfony/console: ^8.2
- symfony/css-selector: ^8.2
- symfony/dom-crawler: ^8.1
- symfony/event-dispatcher: ^8.2
- symfony/event-dispatcher-contracts: ^3.6
- symfony/framework-bundle: ^8.2
- symfony/lock: ^8.2
- symfony/messenger: ^8.2
- symfony/process: ^8.2
- symfony/scheduler: ^8.2
- symfony/translation: ^8.2
- symfony/twig-bundle: ^8.2
- twig/extra-bundle: ^3.24
Suggests
- doctrine/orm: To add the tables to the schema the ORM generates, for doctrine:migrations:diff
- phil/privacy-bundle: For the responses that name a person, and their participations, in the export and the erasure of their data
- symfony/cache-contracts: To keep the last run of the schedule in a cache pool
- symfony/console: For phil:survey:export, phil:survey:import and phil:survey:import-questions
- symfony/lock: To keep the schedule to one worker
- symfony/messenger: To run the purge of the schedule
- symfony/scheduler: To purge the responses past their retention every day
- twig/extra-bundle: To register the html_attr function of twig/html-extra the templates use
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-28 03:03:35 UTC
README
Run surveys that adapt to each answer: conditional sections, ranking and matrix questions, cross quotas, anonymous by default, results shown above a threshold.
phil/survey-bundle is a Symfony bundle for questionnaires. A questionnaire has sections and questions of twelve
types — free text, email, number, date, yes or no, single and multiple choice, ranking, scale, Net Promoter Score and
matrix — and conditions stored as JsonLogic structures, never as code, evaluated by phil/form-logic in the browser
and again on the server. Free answers are checked by phil/forms-bundle; choices, marks, rankings and matrix rows by
the rules of phil/poll, which also counts them.
The server judges every response: hidden questions are dropped, every error is given at once, and the first ending whose condition holds is shown, with its profile, or a redirect to an origin the application allows. Cross quotas are kept by atomic counters in the response's transaction, so concurrent respondents never overfill them.
Questionnaires are anonymous by default, and the page says so before the first question: no respondent, no IP
address, the day only. Session feedback opens in a window around each session; addenda let a respondent add to
a sent response; results are withheld below a minimum, and shown to respondents only when a questionnaire turns them
on. Each questionnaire sets how long its responses are kept, and a scheduled purge deletes the rest. Questionnaires are
made from templates, and exported and imported as JSON with a published schema; their questions also come from a
CSV file through phil/import-wizard, with a dry run that refuses each row the questionnaire would refuse, cell by
cell. The identified responses take part in the export and erasure of phil/privacy-bundle.
The pages work without JavaScript; a Stimulus controller shows a question or a section at a time, with the progress. The tables, on Doctrine DBAL, are tested on SQLite, MySQL 8.4 and PostgreSQL 17.
Status
| Part | State |
|---|---|
| The questionnaire model, its twelve question types and its JSON exchange format and schema | Implemented, tested and fuzzed |
Conditions in structure, evaluated by phil/form-logic; endings, profiles and redirects to allowed origins |
Implemented and tested |
| Responses judged on the server, cross quotas by atomic counters | Implemented and tested, on SQLite, MySQL and PostgreSQL with concurrent respondents |
| Anonymity by default, session feedback and its window, addenda | Implemented and tested |
| Results withheld below a minimum, public results after answering, off by default | Implemented and tested |
| A retention per questionnaire, its scheduled purge | Implemented and tested |
Templates and the session_feedback template |
Implemented and tested |
The CSV import of the questions through phil/import-wizard, its dry run and its command |
Implemented, tested and fuzzed |
The export and the erasure of phil/privacy-bundle |
Implemented and tested |
The pages without JavaScript and the progress Stimulus controller |
Implemented; the controller's pacing tested under Node |
| A visual builder of conditions, exports to spreadsheets | Not started |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements and installing. |
| Configuration | Every option, with an example. |
| Questionnaires | The model, the question types, the conditions, the JSON format and the templates. |
| CSV import | The CSV file of questions, its cells, the dry run, the import into a questionnaire and the command. |
| Responses | Submissions, endings and redirects, quotas, anonymity, session feedback and addenda. |
| Results, retention and privacy | The results and their minimum, the purge, the export and the erasure. |
| Pages | The routes, the templates and the Stimulus controller. |
| Extension points | The services to replace, the tags to add to, and when they are stable. |
| Testing | The bundle's tests, and the servers its integration tests read. |
| Reference | Every class and service of the bundle. |
Quick start
// config/bundles.php Phil\SurveyBundle\PhilSurveyBundle::class => ['all' => true],
# config/packages/phil_survey.yaml phil_survey: redirect_origins: ['https://example.org']
# config/routes/phil_survey.yaml phil_survey: resource: '@PhilSurveyBundle/config/routes.php' prefix: /survey
$questionnaires->fromTemplate('session_feedback', 'keynote', 'Feedback on the keynote'); // GET /survey/keynote?subject=keynote-2026 shows it while the session's feedback is open.
Requirements
PHP 8.5 or later and Symfony 8.2 or later.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.