2026-05-02 00:59:06 +02:00
|
|
|
{
|
|
|
|
|
"name": "php-qml/bridge",
|
|
|
|
|
"description": "Symfony bundle bridging PHP applications to a Qt/QML host (part of the php-qml framework).",
|
|
|
|
|
"type": "symfony-bundle",
|
|
|
|
|
"license": "proprietary",
|
|
|
|
|
"require": {
|
|
|
|
|
"php": "^8.3",
|
2026-05-02 01:05:19 +02:00
|
|
|
"symfony/framework-bundle": "^8.0",
|
|
|
|
|
"symfony/mercure": "^0.7",
|
|
|
|
|
"symfony/security-bundle": "^8.0",
|
|
|
|
|
"symfony/routing": "^8.0",
|
|
|
|
|
"symfony/http-foundation": "^8.0",
|
|
|
|
|
"symfony/console": "^8.0",
|
|
|
|
|
"symfony/dependency-injection": "^8.0",
|
Phase 2 sub-commit 2: ModelPublisher + #[BridgeResource] + Doctrine listener
Bundle gains the model layer that bridges Doctrine entities to Mercure
without per-resource glue. Three new pieces:
- `#[BridgeResource(name: ?string)]` attribute marks an entity as a
reactive bridge model. Topic name defaults to the lowercased class
basename and can be overridden per resource.
- `ModelPublisher` translates entity changes into PLAN.md §4 envelopes
({op, id, data, version, ?correlationKey}) and dual-publishes them
on `app://model/{name}` (collection topic) and `app://model/{name}/{id}`
(entity topic). Entity normalisation goes through Symfony's Serializer
(ObjectNormalizer + DateTime + BackedEnum) for predictable JSON. The
envelope `version` field is a per-process monotonic counter — fine for
single-instance dev mode; production should back this with a Postgres
SEQUENCE or equivalent (noted for Phase 4).
- `DoctrineBridgeListener` registers `postPersist`/`postUpdate`/
`postRemove` via `#[AsDoctrineListener]` and routes events through
ModelPublisher. Entities without `#[BridgeResource]` are silently
skipped.
Plus the correlation-key plumbing the §5 Update Semantics layer needs:
- `CorrelationContext` is a per-request holder for the originating
request's `Idempotency-Key`.
- `CorrelationKeyListener` reads the header on `KernelEvents::REQUEST`
and clears the context on `KernelEvents::TERMINATE` (worker mode
hygiene). CLI mutations see no key, which is correct.
Bundle composer.json picks up `doctrine/dbal`, `doctrine/orm`,
`doctrine/doctrine-bundle`, `symfony/serializer`, `symfony/property-*`,
`symfony/uid`. PHPStan extension `phpstan-doctrine` added so the listener's
event-args types resolve. Skeleton's framework.yaml enables `serializer`
and `property_info`.
Tests: 5 new for ModelPublisher (dual publish, correlation echo, delete
op omits data, untagged entities ignored, version increments). Total:
16 tests, 45 assertions, PHPStan clean, cs-fixer clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 02:32:51 +02:00
|
|
|
"symfony/config": "^8.0",
|
|
|
|
|
"symfony/serializer": "^8.0",
|
|
|
|
|
"symfony/property-access": "^8.0",
|
|
|
|
|
"symfony/property-info": "^8.0",
|
|
|
|
|
"symfony/uid": "^8.0",
|
|
|
|
|
"doctrine/dbal": "^4.0",
|
|
|
|
|
"doctrine/orm": "^3.0",
|
|
|
|
|
"doctrine/doctrine-bundle": "^3.0"
|
2026-05-02 02:25:48 +02:00
|
|
|
},
|
2026-05-02 00:59:06 +02:00
|
|
|
"require-dev": {
|
|
|
|
|
"phpunit/phpunit": "^11",
|
|
|
|
|
"phpstan/phpstan": "^2",
|
|
|
|
|
"phpstan/phpstan-symfony": "^2",
|
Phase 2 sub-commit 2: ModelPublisher + #[BridgeResource] + Doctrine listener
Bundle gains the model layer that bridges Doctrine entities to Mercure
without per-resource glue. Three new pieces:
- `#[BridgeResource(name: ?string)]` attribute marks an entity as a
reactive bridge model. Topic name defaults to the lowercased class
basename and can be overridden per resource.
- `ModelPublisher` translates entity changes into PLAN.md §4 envelopes
({op, id, data, version, ?correlationKey}) and dual-publishes them
on `app://model/{name}` (collection topic) and `app://model/{name}/{id}`
(entity topic). Entity normalisation goes through Symfony's Serializer
(ObjectNormalizer + DateTime + BackedEnum) for predictable JSON. The
envelope `version` field is a per-process monotonic counter — fine for
single-instance dev mode; production should back this with a Postgres
SEQUENCE or equivalent (noted for Phase 4).
- `DoctrineBridgeListener` registers `postPersist`/`postUpdate`/
`postRemove` via `#[AsDoctrineListener]` and routes events through
ModelPublisher. Entities without `#[BridgeResource]` are silently
skipped.
Plus the correlation-key plumbing the §5 Update Semantics layer needs:
- `CorrelationContext` is a per-request holder for the originating
request's `Idempotency-Key`.
- `CorrelationKeyListener` reads the header on `KernelEvents::REQUEST`
and clears the context on `KernelEvents::TERMINATE` (worker mode
hygiene). CLI mutations see no key, which is correct.
Bundle composer.json picks up `doctrine/dbal`, `doctrine/orm`,
`doctrine/doctrine-bundle`, `symfony/serializer`, `symfony/property-*`,
`symfony/uid`. PHPStan extension `phpstan-doctrine` added so the listener's
event-args types resolve. Skeleton's framework.yaml enables `serializer`
and `property_info`.
Tests: 5 new for ModelPublisher (dual publish, correlation echo, delete
op omits data, untagged entities ignored, version increments). Total:
16 tests, 45 assertions, PHPStan clean, cs-fixer clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 02:32:51 +02:00
|
|
|
"phpstan/phpstan-doctrine": "^2",
|
2026-05-02 00:59:06 +02:00
|
|
|
"friendsofphp/php-cs-fixer": "^3",
|
2026-05-02 02:45:42 +02:00
|
|
|
"symfony/phpunit-bridge": "^8.0",
|
|
|
|
|
"symfony/maker-bundle": "^1.62"
|
2026-05-02 00:59:06 +02:00
|
|
|
},
|
|
|
|
|
"autoload": {
|
|
|
|
|
"psr-4": {
|
|
|
|
|
"PhpQml\\Bridge\\": "src/"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"autoload-dev": {
|
|
|
|
|
"psr-4": {
|
|
|
|
|
"PhpQml\\Bridge\\Tests\\": "tests/"
|
|
|
|
|
}
|
|
|
|
|
},
|
Phase 1 sub-commit 7: CI quality job
PHPStan (level 6 + symfony extension) and PHP CS Fixer (Symfony +
PHP83Migration ruleset) configs at framework/php/. composer.json
exposes phpstan / cs:check / cs:fix / phpunit / quality scripts.
PHPStan-clean across the bundle; cs:check is happy after auto-fix
applied @Symfony idioms (yoda, leading-backslash JSON_*, blank-line
before return). Test mocks consolidated into a HubSpy helper to keep
PHPStan happy about by-ref captures.
Skeleton's Makefile target `quality` chains `composer quality` (in
framework/php/) with cmake's all_qmllint target. Local run is green —
11 tests / 32 assertions, no PHPStan errors, cs-fixer clean, qmllint
emits advisory warnings only.
Layout fix in skeleton's Main.qml: status-dot Rectangles inside
RowLayout now use Layout.preferredWidth/Height instead of width/height
to satisfy Quick.layout-positioning checks.
.gitea/workflows/ci.yml replaces the placeholder with a real `quality`
job: setup-php, composer install (cached), the four PHP checks, Qt 6
via install-qt-action (cached), QML module build, qmllint via the
all_qmllint CMake target. Workflow exists from this commit onward
even if a runner isn't provisioned yet.
bridge:doctor lost the Publisher dependency since it was only used as
a "service is wired" marker — the command being injectable already
proves that.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 02:15:06 +02:00
|
|
|
"scripts": {
|
|
|
|
|
"phpstan": "phpstan analyse --memory-limit=512M",
|
|
|
|
|
"cs:check": "php-cs-fixer check --diff --allow-unsupported-php-version=yes",
|
|
|
|
|
"cs:fix": "php-cs-fixer fix --allow-unsupported-php-version=yes",
|
|
|
|
|
"phpunit": "phpunit",
|
|
|
|
|
"quality": [
|
|
|
|
|
"@phpstan",
|
|
|
|
|
"@cs:check",
|
|
|
|
|
"@phpunit"
|
|
|
|
|
]
|
|
|
|
|
},
|
2026-05-02 00:59:06 +02:00
|
|
|
"minimum-stability": "stable"
|
|
|
|
|
}
|