Search by

phil / qa-bundle

phil

Let members answer each other's questions: votes without downvotes, one accepted answer, duplicates closed to a canonical question, Hot sort, reputation.

Package info

github.com/parler-haut-interagir-librement/qa-bundle

Homepage

Type:symfony-bundle

pkg:composer/phil/qa-bundle

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0-alpha 2026-12-02 22:00 UTC

This package is auto-updated.

Last update: 2026-12-03 01:33:26 UTC


README

Questions and answers in a Symfony application: votes without votes against, one accepted answer, duplicates closed to their canonical question, a Hot order a database can sort, and the recognition of helpful members.

phil/qa-bundle is a Symfony bundle. A member asks a question in a section — a course, a group, a category —, others answer it and vote for the useful posts, and the author accepts the answer that solved it. Moderators close the questions that repeat another, and the page shows the accepted answer first, then the others by votes.

  • Votes for, never against: one vote per member and post, never for one's own; a post nobody finds useful stays low. The count is read again from the votes after each change, so that two votes at once never lose one.
  • One accepted answer, by the author of the question or a moderator in their stead; accepting another replaces it.
  • Duplicates closed to their canonical question, never to a chain of duplicates; closing reasons a member reads.
  • Orders shared with the other community pages: Newest, Active, Unanswered, Top, and Hot — the key of phil/ranking, stored and refreshed in bounded batches, so that the database sorts; the answers by the Best sort, where a few votes count less than many.
  • Recognition: a vote or an accepted answer recognizes its author through one interface; with phil/reputation, it becomes reputation under its daily cap, and withdrawing takes back exactly what was given.
  • Structured data: the schema.org QAPage of a page, escaped for its <script> element.
  • Erasure: an erased member's votes are removed and their posts given to a stand-in, so that the answers of others keep their question.
  • Secure and bounded: members are identifiers, never email addresses; titles, bodies, answers per question, listings and batches are bounded; events carry identifiers only; the services hold no state between calls.

Status

Part State
Questions: asking, revising, closing with reasons, duplicates to the canonical question, reopening, deleting Implemented and tested
Answers: one per member by default, revising, deleting, the accepted answer Implemented and tested
Votes without votes against, and the recognitions they give Implemented and tested
Listings by Newest, Active, Unanswered, Top and Hot; the page with answers by votes Implemented and tested
Stored Hot keys refreshed in batches; one reminder to accept an answer Implemented and tested
The schema.org QAPage Implemented and tested
Forgetting an erased member Implemented and tested
phil/reputation integration Implemented and tested
Doctrine and memory stores; the bundle configuration phil_qa Implemented and tested

Documentation

Document What it covers
Installation Requirements, installing, the tables, moderation, reputation and the scheduled work.
Configuration Every option, with an example.
Questions and answers Who does what, answers, the accepted answer, closing and duplicates, the pages, structured data, the policy, events, the scheduled work, erasure.
Votes and reputation Votes, the recognitions they give, and phil/reputation.
Extension points The services to replace, the events to listen to, and when they are stable.
Testing The bundle's tests and benchmark, and testing code that uses it.
Reference Every class and service of the bundle.

Quick start

// config/bundles.php
Phil\QaBundle\PhilQaBundle::class => ['all' => true],
# config/packages/phil_qa.yaml
phil_qa:
    moderators: [member-1]
use Phil\QaBundle\Application\Answers;
use Phil\QaBundle\Application\QaPages;
use Phil\QaBundle\Application\Questions;
use Phil\QaBundle\Application\Votes;

$question = $questions->ask('member-7', 'course-12', 'How do I read a stack trace?', 'It prints forty lines.');
$answer = $answers->answer($question->id(), 'member-3', 'Read it from the bottom up.');
$votes->vote($answer->id(), 'member-9');
$answers->accept($answer->id(), 'member-7');

$page = $pages->page($question->id());   // the accepted answer first, then the others by votes

Requirements

PHP 8.5 or later with ext-mbstring, Symfony 8.2 or later, and Doctrine ORM 3.8 or later for the Doctrine store.

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.