diff --git a/demos/blog-publishing/composer.json b/demos/blog-publishing/composer.json index 3ed4a7c..4370b27 100644 --- a/demos/blog-publishing/composer.json +++ b/demos/blog-publishing/composer.json @@ -18,6 +18,6 @@ "ray/di": "^2.18" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^12" } } diff --git a/demos/contact-form/composer.json b/demos/contact-form/composer.json index c36e9d3..7efb68d 100644 --- a/demos/contact-form/composer.json +++ b/demos/contact-form/composer.json @@ -18,6 +18,6 @@ "ray/di": "^2.18" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^12" } } diff --git a/demos/hello-world/composer.json b/demos/hello-world/composer.json index 9771fe0..795c46a 100644 --- a/demos/hello-world/composer.json +++ b/demos/hello-world/composer.json @@ -18,6 +18,18 @@ "ray/di": "^2.18" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^12" + }, + "scripts": { + "dev": "php bin/be.php 'hello?name=World'", + "profile": "XDEBUG_MODE=trace php -d xdebug.use_compression=0 -d extension=xhprof.so bin/be.php 'hello?name=World'", + "stree": "vendor/bin/stree $(ls -t var/log/*.json | head -1)", + "stree:full": "vendor/bin/stree --full $(ls -t var/log/*.json | head -1)" + }, + "scripts-descriptions": { + "dev": "Run the Hello World demo in dev mode; writes a semantic log to var/log/*.json without Xdebug/XHProf profiling.", + "profile": "Run the Hello World demo with semantic profiling; writes a semantic log to var/log/*.json with uncompressed Xdebug trace and xhprof enabled.", + "stree": "Render the latest var/log/*.json as a compact tree.", + "stree:full": "Render the latest var/log/*.json as a semantic full tree with full props and close.profile details." } } diff --git a/demos/hello-world/stree-full.txt b/demos/hello-world/stree-full.txt new file mode 100644 index 0000000..4548392 --- /dev/null +++ b/demos/hello-world/stree-full.txt @@ -0,0 +1,8 @@ +becoming HelloInput +├── name: World +├── being_final Hello input=[name] inject=[greeting] +│ ├── inject.greeting: Be\Pattern\Hello\Reason\Greeting +│ └── close +│ └── greeting: Hello World +└── close + └── exit: success diff --git a/demos/hello-world/stree.txt b/demos/hello-world/stree.txt new file mode 100644 index 0000000..da86138 --- /dev/null +++ b/demos/hello-world/stree.txt @@ -0,0 +1,4 @@ +becoming HelloInput +├── being_final Hello input=[name] inject=[greeting] +│ └── prop=[greeting] +└── exit=success diff --git a/demos/insurance-claim/composer.json b/demos/insurance-claim/composer.json index c9458bd..4cdf0a8 100644 --- a/demos/insurance-claim/composer.json +++ b/demos/insurance-claim/composer.json @@ -17,6 +17,6 @@ "ray/di": "^2.18" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^12" } } diff --git a/demos/loan-application/composer.json b/demos/loan-application/composer.json index 9690512..7e0c68c 100644 --- a/demos/loan-application/composer.json +++ b/demos/loan-application/composer.json @@ -17,6 +17,6 @@ "ray/di": "^2.18" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^12" } } diff --git a/demos/medical-triage/composer.json b/demos/medical-triage/composer.json index 0112787..76028f6 100644 --- a/demos/medical-triage/composer.json +++ b/demos/medical-triage/composer.json @@ -17,6 +17,18 @@ "ray/di": "^2.18" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^12" + }, + "scripts": { + "dev": "php bin/be.php", + "profile": "XDEBUG_MODE=trace php -d xdebug.use_compression=0 -d extension=xhprof.so bin/be.php", + "stree": "vendor/bin/stree $(ls -t var/log/*.json | head -1)", + "stree:full": "vendor/bin/stree --full $(ls -t var/log/*.json | head -1)" + }, + "scripts-descriptions": { + "dev": "Run the Medical Triage demo in dev mode; writes a semantic log to var/log/*.json without Xdebug/XHProf profiling.", + "profile": "Run the Medical Triage demo with semantic profiling; writes a semantic log to var/log/*.json with uncompressed Xdebug trace and xhprof enabled.", + "stree": "Render the latest var/log/*.json as a compact tree.", + "stree:full": "Render the latest var/log/*.json as a semantic full tree with full props and close.profile details." } } diff --git a/demos/medical-triage/stree-full.txt b/demos/medical-triage/stree-full.txt new file mode 100644 index 0000000..afb5ea3 --- /dev/null +++ b/demos/medical-triage/stree-full.txt @@ -0,0 +1,20 @@ +becoming PatientInput +├── patientId: PT-10001 +├── chiefComplaint: severe chest pain +├── consciousnessLevel: 0 +├── being TriageLevelDetermined input=[patientId, chiefComplaint +1 items] inject=[protocol] +│ ├── inject.protocol: Be\Pattern\MedicalTriage\Reason\JTASProtocol +│ └── close +│ ├── being.triageCode: RED +│ ├── patientId: PT-10001 +│ ├── chiefComplaint: severe chest pain +│ └── consciousnessLevel: 0 +├── being_final EmergencyAdmitted input=[being, patientId] +│ └── close +│ ├── admissionId: ADM-20260422-9b8b8250 +│ ├── status: admitted +│ ├── triageCode: RED +│ ├── being.triageCode: RED +│ └── patientId: PT-10001 +└── close + └── exit: success diff --git a/demos/medical-triage/stree.txt b/demos/medical-triage/stree.txt new file mode 100644 index 0000000..95e7d80 --- /dev/null +++ b/demos/medical-triage/stree.txt @@ -0,0 +1,6 @@ +becoming PatientInput +├── being TriageLevelDetermined input=[patientId, chiefComplaint +1 items] inject=[protocol] +│ └── being=TriageLevelDetermined prop=[being, patientId, chiefComplaint +1 items] +├── being_final EmergencyAdmitted input=[being, patientId] +│ └── prop=[admissionId, status, triageCode, being +1 items] +└── exit=success diff --git a/demos/order-processing/composer.json b/demos/order-processing/composer.json index 77cb827..47fa0a9 100644 --- a/demos/order-processing/composer.json +++ b/demos/order-processing/composer.json @@ -17,6 +17,18 @@ "ray/di": "^2.18" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^12" + }, + "scripts": { + "dev": "php bin/be.php", + "profile": "XDEBUG_MODE=trace php -d xdebug.use_compression=0 -d extension=xhprof.so bin/be.php", + "stree": "vendor/bin/stree $(ls -t var/log/*.json | head -1)", + "stree:full": "vendor/bin/stree --full $(ls -t var/log/*.json | head -1)" + }, + "scripts-descriptions": { + "dev": "Run the Order Processing demo in dev mode; writes a semantic log to var/log/*.json without Xdebug/XHProf profiling.", + "profile": "Run the Order Processing demo with semantic profiling; writes a semantic log to var/log/*.json with uncompressed Xdebug trace and xhprof enabled.", + "stree": "Render the latest var/log/*.json as a compact tree.", + "stree:full": "Render the latest var/log/*.json as a semantic full tree with full props and close.profile details." } } diff --git a/demos/order-processing/stree-full.txt b/demos/order-processing/stree-full.txt new file mode 100644 index 0000000..cd2e0f6 --- /dev/null +++ b/demos/order-processing/stree-full.txt @@ -0,0 +1,35 @@ +becoming OrderInput +├── cartId: CART-001 +├── customerId: CUST-001 +├── cardNumber: 4111111111111111 +├── cardExpiry: 12/25 +├── cardCvv: 123 +├── postalCode: 150-0001 +├── streetAddress: 渋谷区神宮前1-1-1 +├── being_final OrderConfirmed inject=[inventory, payment, shipping, been] +│ ├── inject.inventory: Be\Pattern\OrderProcessing\Moment\InventoryReserved +│ ├── inject.payment: Be\Pattern\OrderProcessing\Moment\PaymentCompleted +│ ├── inject.shipping: Be\Pattern\OrderProcessing\Moment\ShippingArranged +│ ├── inject.been: Be\Framework\SemanticLog\Been +│ ├── order_finalized orderId=ORD-20260422-67163ba8 status=confirmed [event] +│ │ ├── orderId: ORD-20260422-67163ba8 +│ │ └── status: confirmed +│ └── close +│ ├── orderId: ORD-20260422-67163ba8 +│ ├── status: confirmed +│ ├── inventory.reservation.reservationId: RSV-TOKYO-20260422032619-2893 +│ ├── inventory.productId: PROD-001 +│ ├── inventory.quantity: 1 +│ ├── inventory.warehouseId: WH-TOKYO-01 +│ ├── payment.capture.authorizationCode: AUTH-10000-4cb8d550 +│ ├── payment.capture.amount: 10000 +│ ├── payment.cardNumber: 4111111111111111 +│ ├── payment.amount: 10000 +│ ├── shipping.dispatch.trackingNumber: YAMATO-202604220326199860 +│ ├── shipping.dispatch.shippingRate: 800 +│ ├── shipping.carrierId: YAMATO +│ ├── shipping.address: Tokyo, Japan +│ ├── been[0].orderId: ORD-20260422-67163ba8 +│ └── been[0].status: confirmed +└── close + └── exit: success diff --git a/demos/order-processing/stree.txt b/demos/order-processing/stree.txt new file mode 100644 index 0000000..4a9c96c --- /dev/null +++ b/demos/order-processing/stree.txt @@ -0,0 +1,5 @@ +becoming OrderInput +├── being_final OrderConfirmed inject=[inventory, payment, shipping, been] +│ ├── order_finalized orderId=ORD-20260422-67163ba8 status=confirmed [event] +│ └── prop=[orderId, status, inventory, payment +1 items] been=[1 items] +└── exit=success diff --git a/demos/user-registration/composer.json b/demos/user-registration/composer.json index d513a54..0b77b6b 100644 --- a/demos/user-registration/composer.json +++ b/demos/user-registration/composer.json @@ -19,6 +19,18 @@ "ray/di": "^2.18" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^12" + }, + "scripts": { + "dev": "php bin/be.php", + "profile": "XDEBUG_MODE=trace php -d xdebug.use_compression=0 -d extension=xhprof.so bin/be.php", + "stree": "vendor/bin/stree $(ls -t var/log/*.json | head -1)", + "stree:full": "vendor/bin/stree --full $(ls -t var/log/*.json | head -1)" + }, + "scripts-descriptions": { + "dev": "Run the User Registration demo in dev mode; writes a semantic log to var/log/*.json without Xdebug/XHProf profiling.", + "profile": "Run the User Registration demo with semantic profiling; writes a semantic log to var/log/*.json with uncompressed Xdebug trace and xhprof enabled.", + "stree": "Render the latest var/log/*.json as a compact tree.", + "stree:full": "Render the latest var/log/*.json as a semantic full tree with full props and close.profile details." } } diff --git a/demos/user-registration/stree-full.txt b/demos/user-registration/stree-full.txt new file mode 100644 index 0000000..fdcca1e --- /dev/null +++ b/demos/user-registration/stree-full.txt @@ -0,0 +1,41 @@ +becoming RegistrationInput +├── email: alice@example.com +├── password: Str0ngP@ss +├── displayName: Alice +├── being EmailVerified input=[email, password, displayName] inject=[verifier] +│ ├── inject.verifier: Be\Pattern\UserRegistration\Reason\EmailVerifier +│ └── close +│ ├── email: alice@example.com +│ ├── password: Str0ngP@ss +│ └── displayName: Alice +├── being PasswordHashed input=[email, password, displayName] inject=[hasher] +│ ├── inject.hasher: Be\Pattern\UserRegistration\Reason\PasswordHasher +│ └── close +│ ├── hashedPassword: $2y$12$6FqPq/JWd4QgJ9vGgUMtb.hHIz2bavynhdUGttlwJxSgK7GsWbYya +│ ├── email: alice@example.com +│ └── displayName: Alice +├── being ProfileEnriched input=[email, displayName, hashedPassword] inject=[resolver] +│ ├── inject.resolver: Be\Pattern\UserRegistration\Reason\GravatarResolver +│ └── close +│ ├── avatarUrl: https://www.gravatar.com/avatar/c160f8cc69a4f0bf2b0362752353d060 +│ ├── email: alice@example.com +│ ├── displayName: Alice +│ └── hashedPassword: $2y$12$6FqPq/JWd4QgJ9vGgUMtb.hHIz2bavynhdUGttlwJxSgK7GsWbYya +├── being_final UserRegistered input=[email, displayName, hashedPassword +1 items] inject=[idGen, tokenGen, been] +│ ├── inject.idGen: Be\Pattern\UserRegistration\Reason\UserIdGenerator +│ ├── inject.tokenGen: Be\Pattern\UserRegistration\Reason\WelcomeTokenGenerator +│ ├── inject.been: Be\Framework\SemanticLog\Been +│ ├── user_created userId=USR-20260422-13e3e4ef35a36429 email=alice@example.com [event] +│ │ ├── userId: USR-20260422-13e3e4ef35a36429 +│ │ └── email: alice@example.com +│ └── close +│ ├── userId: USR-20260422-13e3e4ef35a36429 +│ ├── welcomeToken: 0f1acca67431022f22ab5cb09ed9a341246eba5d5d24c520d1037919a8a41ef5 +│ ├── email: alice@example.com +│ ├── displayName: Alice +│ ├── hashedPassword: $2y$12$6FqPq/JWd4QgJ9vGgUMtb.hHIz2bavynhdUGttlwJxSgK7GsWbYya +│ ├── avatarUrl: https://www.gravatar.com/avatar/c160f8cc69a4f0bf2b0362752353d060 +│ ├── been[0].userId: USR-20260422-13e3e4ef35a36429 +│ └── been[0].email: alice@example.com +└── close + └── exit: success diff --git a/demos/user-registration/stree.txt b/demos/user-registration/stree.txt new file mode 100644 index 0000000..b81623a --- /dev/null +++ b/demos/user-registration/stree.txt @@ -0,0 +1,11 @@ +becoming RegistrationInput +├── being EmailVerified input=[email, password, displayName] inject=[verifier] +│ └── being=EmailVerified prop=[email, password, displayName] +├── being PasswordHashed input=[email, password, displayName] inject=[hasher] +│ └── being=PasswordHashed prop=[hashedPassword, email, displayName] +├── being ProfileEnriched input=[email, displayName, hashedPassword] inject=[resolver] +│ └── being=ProfileEnriched prop=[avatarUrl, email, displayName +1 items] +├── being_final UserRegistered input=[email, displayName, hashedPassword +1 items] inject=[idGen, tokenGen, been] +│ ├── user_created userId=USR-20260422-13e3e4ef35a36429 email=alice@example.com [event] +│ └── prop=[userId, welcomeToken, email, displayName +2 items] been=[1 items] +└── exit=success