From d45b878513f2363ff492b50fc16cacb26246aaf0 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Fri, 17 Apr 2026 01:02:50 +0900 Subject: [PATCH 1/2] rename order-processing namespace Be\App\* to Be\Pattern\OrderProcessing\* Completes the namespace normalization that PR #12 started. The order-processing demo was the only remaining demo using the legacy Be\App\* root; this aligns it with the Be\Pattern\\* convention shared by the other seven demos. - demos/order-processing/: 86 PHP files + composer.json (name and autoload) - docs/templates/: drop references to the alternate Be\App\ form - CLAUDE.md: drop Be\App alternative from the namespace invariant All 8 demos pass (178 tests / 352 assertions). --- CLAUDE.md | 3 +- demos/order-processing/bin/app.php | 6 +-- demos/order-processing/composer.json | 6 +-- .../docs/comparison/After_BeFramework.php | 2 +- .../src/Attribute/Address.php | 2 +- .../order-processing/src/Attribute/Amount.php | 2 +- .../src/Attribute/AuthorizationCode.php | 2 +- .../src/Attribute/CardNumber.php | 2 +- .../src/Attribute/CarrierId.php | 2 +- .../src/Attribute/ProductId.php | 2 +- .../src/Attribute/Quantity.php | 2 +- .../src/Attribute/WarehouseId.php | 2 +- .../src/Being/Inventory/QuantityChecked.php | 4 +- .../src/Being/Inventory/StockLocated.php | 4 +- .../src/Being/Payment/CardValidated.php | 4 +- .../src/Being/Payment/PaymentAuthorized.php | 6 +-- .../src/Being/Shipping/AddressValidated.php | 4 +- .../src/Being/Shipping/CarrierSelected.php | 4 +- .../src/Exception/EmptyNameException.php | 2 +- .../Exception/InsufficientStockException.php | 2 +- .../src/Exception/InvalidAddressException.php | 2 +- .../src/Exception/InvalidAmountException.php | 2 +- .../src/Exception/InvalidCardCvvException.php | 2 +- .../Exception/InvalidCardExpiryException.php | 2 +- .../Exception/InvalidCardNumberException.php | 2 +- .../src/Exception/InvalidCartIdException.php | 2 +- .../Exception/InvalidCustomerIdException.php | 2 +- .../Exception/InvalidPostalCodeException.php | 2 +- .../Exception/InvalidProductIdException.php | 2 +- .../Exception/InvalidQuantityException.php | 2 +- .../InvalidStreetAddressException.php | 2 +- .../Exception/InvalidWarehouseIdException.php | 2 +- .../src/Exception/PaymentFailedException.php | 2 +- .../src/Final/OrderConfirmed.php | 8 ++-- .../order-processing/src/Input/OrderInput.php | 4 +- .../order-processing/src/Module/AppModule.php | 38 +++++++++---------- .../src/Moment/InventoryReserved.php | 12 +++--- .../src/Moment/MomentInterface.php | 2 +- .../src/Moment/PaymentCompleted.php | 10 ++--- .../Moment/Potential/InventoryReservation.php | 4 +- .../src/Moment/Potential/PaymentCapture.php | 4 +- .../src/Moment/Potential/ShippingDispatch.php | 4 +- .../src/Moment/ShippingArranged.php | 10 ++--- .../src/Reason/AddressValidator.php | 2 +- .../src/Reason/CardValidator.php | 2 +- .../src/Reason/CarrierSelector.php | 2 +- .../src/Reason/InventoryChecker.php | 2 +- .../src/Reason/InventoryReserver.php | 4 +- .../src/Reason/InventoryReserverInterface.php | 4 +- .../src/Reason/PaymentGateway.php | 4 +- .../src/Reason/PaymentGatewayInterface.php | 4 +- .../src/Reason/ShippingArranger.php | 4 +- .../src/Reason/ShippingArrangerInterface.php | 4 +- .../src/Reason/WarehouseLocator.php | 2 +- .../order-processing/src/Semantic/Amount.php | 4 +- .../order-processing/src/Semantic/CardCvv.php | 4 +- .../src/Semantic/CardExpiry.php | 4 +- .../src/Semantic/CardNumber.php | 4 +- .../order-processing/src/Semantic/CartId.php | 4 +- .../src/Semantic/CustomerId.php | 4 +- demos/order-processing/src/Semantic/Name.php | 4 +- .../src/Semantic/PostalCode.php | 4 +- .../src/Semantic/ProductId.php | 4 +- .../src/Semantic/Quantity.php | 4 +- .../src/Semantic/StreetAddress.php | 4 +- .../src/Semantic/WarehouseId.php | 4 +- .../tests/Becoming/OrderBecomingTest.php | 8 ++-- .../Being/Inventory/QuantityCheckedTest.php | 6 +-- .../Being/Inventory/StockLocatedTest.php | 6 +-- .../tests/Being/Payment/CardValidatedTest.php | 6 +-- .../Being/Payment/PaymentAuthorizedTest.php | 8 ++-- .../Being/Shipping/AddressValidatedTest.php | 6 +-- .../Being/Shipping/CarrierSelectedTest.php | 6 +-- .../tests/Final/OrderConfirmedTest.php | 18 ++++----- .../tests/Moment/InventoryReservedTest.php | 6 +-- .../tests/Moment/PaymentCompletedTest.php | 6 +-- .../tests/Moment/ShippingArrangedTest.php | 6 +-- .../tests/Reason/AddressValidatorTest.php | 4 +- .../tests/Reason/CardValidatorTest.php | 4 +- .../tests/Reason/CarrierSelectorTest.php | 4 +- .../tests/Reason/InventoryCheckerTest.php | 4 +- .../tests/Reason/InventoryReserverTest.php | 6 +-- .../tests/Reason/PaymentGatewayTest.php | 6 +-- .../tests/Reason/ShippingArrangerTest.php | 6 +-- .../tests/Reason/WarehouseLocatorTest.php | 4 +- .../tests/Semantic/CardNumberTest.php | 6 +-- .../tests/Semantic/PostalCodeTest.php | 6 +-- .../tests/Semantic/QuantityTest.php | 6 +-- docs/templates/BeingTemplate.php | 2 +- docs/templates/FinalTemplate.php | 2 +- docs/templates/InputTemplate.php | 2 +- docs/templates/MomentTemplate.php | 6 +-- docs/templates/README.md | 10 ++--- docs/templates/ReasonInterfaceTemplate.php | 2 +- docs/templates/SemanticTemplate.php | 2 +- 95 files changed, 215 insertions(+), 216 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3088fbc..b14e130 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -95,8 +95,7 @@ will not run under Ray.Di or will break framework expectations. 8. **Reason services**: always define an `…Interface` and depend on the interface, never the concrete class. Ray.Di binds the implementation. 9. **Namespaces**: follow the existing per-demo pattern - (`Be\Pattern\\\…` or `Be\App\\…`). Never invent a new - root namespace. + `Be\Pattern\\\…`. Never invent a new root namespace. 10. **No side effects in Beings.** A Being transforms data; external I/O belongs in an injected Reason service. diff --git a/demos/order-processing/bin/app.php b/demos/order-processing/bin/app.php index ca02447..c90da65 100644 --- a/demos/order-processing/bin/app.php +++ b/demos/order-processing/bin/app.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Be\App; +namespace Be\Pattern\OrderProcessing; require dirname(__DIR__) . '/vendor/autoload.php'; -use Be\App\Input\OrderInput; -use Be\App\Module\AppModule; +use Be\Pattern\OrderProcessing\Input\OrderInput; +use Be\Pattern\OrderProcessing\Module\AppModule; use Be\Framework\Becoming; use Be\Framework\Exception\SemanticVariableException; use Ray\Di\Injector; diff --git a/demos/order-processing/composer.json b/demos/order-processing/composer.json index ff0d91a..77cb827 100644 --- a/demos/order-processing/composer.json +++ b/demos/order-processing/composer.json @@ -1,14 +1,14 @@ { - "name": "be-framework/app", + "name": "be-framework/demo-order-processing", "type": "project", "autoload": { "psr-4": { - "Be\\App\\": "src/" + "Be\\Pattern\\OrderProcessing\\": "src/" } }, "autoload-dev": { "psr-4": { - "Be\\App\\Tests\\": "tests/" + "Be\\Pattern\\OrderProcessing\\Tests\\": "tests/" } }, "require": { diff --git a/demos/order-processing/docs/comparison/After_BeFramework.php b/demos/order-processing/docs/comparison/After_BeFramework.php index b5f9f29..a935f00 100644 --- a/demos/order-processing/docs/comparison/After_BeFramework.php +++ b/demos/order-processing/docs/comparison/After_BeFramework.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace Be\App; +namespace Be\Pattern\OrderProcessing; // ═══════════════════════════════════════════════════════════════════════════ // INPUT - The starting point (Aristotle's Dynamis - Potentiality) diff --git a/demos/order-processing/src/Attribute/Address.php b/demos/order-processing/src/Attribute/Address.php index 84ab0dc..cec018a 100644 --- a/demos/order-processing/src/Attribute/Address.php +++ b/demos/order-processing/src/Attribute/Address.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Attribute; +namespace Be\Pattern\OrderProcessing\Attribute; use Attribute; use Ray\Di\Di\Qualifier; diff --git a/demos/order-processing/src/Attribute/Amount.php b/demos/order-processing/src/Attribute/Amount.php index e7fcc31..56dab4b 100644 --- a/demos/order-processing/src/Attribute/Amount.php +++ b/demos/order-processing/src/Attribute/Amount.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Attribute; +namespace Be\Pattern\OrderProcessing\Attribute; use Attribute; use Ray\Di\Di\Qualifier; diff --git a/demos/order-processing/src/Attribute/AuthorizationCode.php b/demos/order-processing/src/Attribute/AuthorizationCode.php index 7ceb1f1..7ce0b48 100644 --- a/demos/order-processing/src/Attribute/AuthorizationCode.php +++ b/demos/order-processing/src/Attribute/AuthorizationCode.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Attribute; +namespace Be\Pattern\OrderProcessing\Attribute; use Attribute; use Ray\Di\Di\Qualifier; diff --git a/demos/order-processing/src/Attribute/CardNumber.php b/demos/order-processing/src/Attribute/CardNumber.php index 1ce3f6f..487c53f 100644 --- a/demos/order-processing/src/Attribute/CardNumber.php +++ b/demos/order-processing/src/Attribute/CardNumber.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Attribute; +namespace Be\Pattern\OrderProcessing\Attribute; use Attribute; use Ray\Di\Di\Qualifier; diff --git a/demos/order-processing/src/Attribute/CarrierId.php b/demos/order-processing/src/Attribute/CarrierId.php index f398198..add0d68 100644 --- a/demos/order-processing/src/Attribute/CarrierId.php +++ b/demos/order-processing/src/Attribute/CarrierId.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Attribute; +namespace Be\Pattern\OrderProcessing\Attribute; use Attribute; use Ray\Di\Di\Qualifier; diff --git a/demos/order-processing/src/Attribute/ProductId.php b/demos/order-processing/src/Attribute/ProductId.php index 33fd3b3..6d695ba 100644 --- a/demos/order-processing/src/Attribute/ProductId.php +++ b/demos/order-processing/src/Attribute/ProductId.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Attribute; +namespace Be\Pattern\OrderProcessing\Attribute; use Attribute; use Ray\Di\Di\Qualifier; diff --git a/demos/order-processing/src/Attribute/Quantity.php b/demos/order-processing/src/Attribute/Quantity.php index 200800c..845feab 100644 --- a/demos/order-processing/src/Attribute/Quantity.php +++ b/demos/order-processing/src/Attribute/Quantity.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Attribute; +namespace Be\Pattern\OrderProcessing\Attribute; use Attribute; use Ray\Di\Di\Qualifier; diff --git a/demos/order-processing/src/Attribute/WarehouseId.php b/demos/order-processing/src/Attribute/WarehouseId.php index 3e51813..5e20b38 100644 --- a/demos/order-processing/src/Attribute/WarehouseId.php +++ b/demos/order-processing/src/Attribute/WarehouseId.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Attribute; +namespace Be\Pattern\OrderProcessing\Attribute; use Attribute; use Ray\Di\Di\Qualifier; diff --git a/demos/order-processing/src/Being/Inventory/QuantityChecked.php b/demos/order-processing/src/Being/Inventory/QuantityChecked.php index d460c57..993ec6e 100644 --- a/demos/order-processing/src/Being/Inventory/QuantityChecked.php +++ b/demos/order-processing/src/Being/Inventory/QuantityChecked.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Be\App\Being\Inventory; +namespace Be\Pattern\OrderProcessing\Being\Inventory; use Ray\InputQuery\Attribute\Input; use Ray\Di\Di\Inject; -use Be\App\Reason\InventoryChecker; +use Be\Pattern\OrderProcessing\Reason\InventoryChecker; final readonly class QuantityChecked { diff --git a/demos/order-processing/src/Being/Inventory/StockLocated.php b/demos/order-processing/src/Being/Inventory/StockLocated.php index 58e1352..b545482 100644 --- a/demos/order-processing/src/Being/Inventory/StockLocated.php +++ b/demos/order-processing/src/Being/Inventory/StockLocated.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Be\App\Being\Inventory; +namespace Be\Pattern\OrderProcessing\Being\Inventory; use Ray\InputQuery\Attribute\Input; use Ray\Di\Di\Inject; -use Be\App\Reason\WarehouseLocator; +use Be\Pattern\OrderProcessing\Reason\WarehouseLocator; final readonly class StockLocated { diff --git a/demos/order-processing/src/Being/Payment/CardValidated.php b/demos/order-processing/src/Being/Payment/CardValidated.php index 6db3e24..65a46af 100644 --- a/demos/order-processing/src/Being/Payment/CardValidated.php +++ b/demos/order-processing/src/Being/Payment/CardValidated.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Be\App\Being\Payment; +namespace Be\Pattern\OrderProcessing\Being\Payment; use Ray\InputQuery\Attribute\Input; use Ray\Di\Di\Inject; -use Be\App\Reason\CardValidator; +use Be\Pattern\OrderProcessing\Reason\CardValidator; final readonly class CardValidated { diff --git a/demos/order-processing/src/Being/Payment/PaymentAuthorized.php b/demos/order-processing/src/Being/Payment/PaymentAuthorized.php index f36ce0e..9f8a4f7 100644 --- a/demos/order-processing/src/Being/Payment/PaymentAuthorized.php +++ b/demos/order-processing/src/Being/Payment/PaymentAuthorized.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Being\Payment; +namespace Be\Pattern\OrderProcessing\Being\Payment; -use Be\App\Moment\Potential\PaymentCapture; -use Be\App\Reason\PaymentGateway; +use Be\Pattern\OrderProcessing\Moment\Potential\PaymentCapture; +use Be\Pattern\OrderProcessing\Reason\PaymentGateway; use Ray\Di\Di\Inject; use Ray\InputQuery\Attribute\Input; diff --git a/demos/order-processing/src/Being/Shipping/AddressValidated.php b/demos/order-processing/src/Being/Shipping/AddressValidated.php index 2b92f3b..cc7079c 100644 --- a/demos/order-processing/src/Being/Shipping/AddressValidated.php +++ b/demos/order-processing/src/Being/Shipping/AddressValidated.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Be\App\Being\Shipping; +namespace Be\Pattern\OrderProcessing\Being\Shipping; use Ray\InputQuery\Attribute\Input; use Ray\Di\Di\Inject; -use Be\App\Reason\AddressValidator; +use Be\Pattern\OrderProcessing\Reason\AddressValidator; final readonly class AddressValidated { diff --git a/demos/order-processing/src/Being/Shipping/CarrierSelected.php b/demos/order-processing/src/Being/Shipping/CarrierSelected.php index 41d6da0..104a398 100644 --- a/demos/order-processing/src/Being/Shipping/CarrierSelected.php +++ b/demos/order-processing/src/Being/Shipping/CarrierSelected.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Be\App\Being\Shipping; +namespace Be\Pattern\OrderProcessing\Being\Shipping; use Ray\InputQuery\Attribute\Input; use Ray\Di\Di\Inject; -use Be\App\Reason\CarrierSelector; +use Be\Pattern\OrderProcessing\Reason\CarrierSelector; final readonly class CarrierSelected { diff --git a/demos/order-processing/src/Exception/EmptyNameException.php b/demos/order-processing/src/Exception/EmptyNameException.php index a3832b5..c0e1762 100644 --- a/demos/order-processing/src/Exception/EmptyNameException.php +++ b/demos/order-processing/src/Exception/EmptyNameException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InsufficientStockException.php b/demos/order-processing/src/Exception/InsufficientStockException.php index c229b0a..54d6b72 100644 --- a/demos/order-processing/src/Exception/InsufficientStockException.php +++ b/demos/order-processing/src/Exception/InsufficientStockException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidAddressException.php b/demos/order-processing/src/Exception/InvalidAddressException.php index 423669d..0401556 100644 --- a/demos/order-processing/src/Exception/InvalidAddressException.php +++ b/demos/order-processing/src/Exception/InvalidAddressException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidAmountException.php b/demos/order-processing/src/Exception/InvalidAmountException.php index 07ac1e1..f79152e 100644 --- a/demos/order-processing/src/Exception/InvalidAmountException.php +++ b/demos/order-processing/src/Exception/InvalidAmountException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidCardCvvException.php b/demos/order-processing/src/Exception/InvalidCardCvvException.php index 9f0f8e3..5a4ac21 100644 --- a/demos/order-processing/src/Exception/InvalidCardCvvException.php +++ b/demos/order-processing/src/Exception/InvalidCardCvvException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidCardExpiryException.php b/demos/order-processing/src/Exception/InvalidCardExpiryException.php index b958de8..80272d5 100644 --- a/demos/order-processing/src/Exception/InvalidCardExpiryException.php +++ b/demos/order-processing/src/Exception/InvalidCardExpiryException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidCardNumberException.php b/demos/order-processing/src/Exception/InvalidCardNumberException.php index 982881c..fbf0b01 100644 --- a/demos/order-processing/src/Exception/InvalidCardNumberException.php +++ b/demos/order-processing/src/Exception/InvalidCardNumberException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidCartIdException.php b/demos/order-processing/src/Exception/InvalidCartIdException.php index accb638..e6f9b0e 100644 --- a/demos/order-processing/src/Exception/InvalidCartIdException.php +++ b/demos/order-processing/src/Exception/InvalidCartIdException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidCustomerIdException.php b/demos/order-processing/src/Exception/InvalidCustomerIdException.php index 0837d29..bd905bf 100644 --- a/demos/order-processing/src/Exception/InvalidCustomerIdException.php +++ b/demos/order-processing/src/Exception/InvalidCustomerIdException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidPostalCodeException.php b/demos/order-processing/src/Exception/InvalidPostalCodeException.php index f954f07..3ae01a8 100644 --- a/demos/order-processing/src/Exception/InvalidPostalCodeException.php +++ b/demos/order-processing/src/Exception/InvalidPostalCodeException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidProductIdException.php b/demos/order-processing/src/Exception/InvalidProductIdException.php index 9a3b99f..2de1912 100644 --- a/demos/order-processing/src/Exception/InvalidProductIdException.php +++ b/demos/order-processing/src/Exception/InvalidProductIdException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidQuantityException.php b/demos/order-processing/src/Exception/InvalidQuantityException.php index 1308250..b37b123 100644 --- a/demos/order-processing/src/Exception/InvalidQuantityException.php +++ b/demos/order-processing/src/Exception/InvalidQuantityException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidStreetAddressException.php b/demos/order-processing/src/Exception/InvalidStreetAddressException.php index b08f916..4a656e9 100644 --- a/demos/order-processing/src/Exception/InvalidStreetAddressException.php +++ b/demos/order-processing/src/Exception/InvalidStreetAddressException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/InvalidWarehouseIdException.php b/demos/order-processing/src/Exception/InvalidWarehouseIdException.php index a87a05f..e1d4d4d 100644 --- a/demos/order-processing/src/Exception/InvalidWarehouseIdException.php +++ b/demos/order-processing/src/Exception/InvalidWarehouseIdException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Exception/PaymentFailedException.php b/demos/order-processing/src/Exception/PaymentFailedException.php index c67053a..cabf241 100644 --- a/demos/order-processing/src/Exception/PaymentFailedException.php +++ b/demos/order-processing/src/Exception/PaymentFailedException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Exception; +namespace Be\Pattern\OrderProcessing\Exception; use Be\Framework\Attribute\Message; use DomainException; diff --git a/demos/order-processing/src/Final/OrderConfirmed.php b/demos/order-processing/src/Final/OrderConfirmed.php index 078d26b..91ee79a 100644 --- a/demos/order-processing/src/Final/OrderConfirmed.php +++ b/demos/order-processing/src/Final/OrderConfirmed.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Be\App\Final; +namespace Be\Pattern\OrderProcessing\Final; -use Be\App\Moment\InventoryReserved; -use Be\App\Moment\PaymentCompleted; -use Be\App\Moment\ShippingArranged; +use Be\Pattern\OrderProcessing\Moment\InventoryReserved; +use Be\Pattern\OrderProcessing\Moment\PaymentCompleted; +use Be\Pattern\OrderProcessing\Moment\ShippingArranged; use Ray\Di\Di\Inject; /** diff --git a/demos/order-processing/src/Input/OrderInput.php b/demos/order-processing/src/Input/OrderInput.php index 64d4e87..d9a3433 100644 --- a/demos/order-processing/src/Input/OrderInput.php +++ b/demos/order-processing/src/Input/OrderInput.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Input; +namespace Be\Pattern\OrderProcessing\Input; -use Be\App\Final\OrderConfirmed; +use Be\Pattern\OrderProcessing\Final\OrderConfirmed; use Be\Framework\Attribute\Be; /** diff --git a/demos/order-processing/src/Module/AppModule.php b/demos/order-processing/src/Module/AppModule.php index d132d79..790815b 100644 --- a/demos/order-processing/src/Module/AppModule.php +++ b/demos/order-processing/src/Module/AppModule.php @@ -2,26 +2,26 @@ declare(strict_types=1); -namespace Be\App\Module; +namespace Be\Pattern\OrderProcessing\Module; -use Be\App\Attribute\Address; -use Be\App\Attribute\Amount; -use Be\App\Attribute\CardNumber; -use Be\App\Attribute\CarrierId; -use Be\App\Attribute\ProductId; -use Be\App\Attribute\Quantity; -use Be\App\Attribute\WarehouseId; -use Be\App\Reason\AddressValidator; -use Be\App\Reason\CardValidator; -use Be\App\Reason\CarrierSelector; -use Be\App\Reason\InventoryChecker; -use Be\App\Reason\InventoryReserver; -use Be\App\Reason\InventoryReserverInterface; -use Be\App\Reason\PaymentGateway; -use Be\App\Reason\PaymentGatewayInterface; -use Be\App\Reason\ShippingArranger; -use Be\App\Reason\ShippingArrangerInterface; -use Be\App\Reason\WarehouseLocator; +use Be\Pattern\OrderProcessing\Attribute\Address; +use Be\Pattern\OrderProcessing\Attribute\Amount; +use Be\Pattern\OrderProcessing\Attribute\CardNumber; +use Be\Pattern\OrderProcessing\Attribute\CarrierId; +use Be\Pattern\OrderProcessing\Attribute\ProductId; +use Be\Pattern\OrderProcessing\Attribute\Quantity; +use Be\Pattern\OrderProcessing\Attribute\WarehouseId; +use Be\Pattern\OrderProcessing\Reason\AddressValidator; +use Be\Pattern\OrderProcessing\Reason\CardValidator; +use Be\Pattern\OrderProcessing\Reason\CarrierSelector; +use Be\Pattern\OrderProcessing\Reason\InventoryChecker; +use Be\Pattern\OrderProcessing\Reason\InventoryReserver; +use Be\Pattern\OrderProcessing\Reason\InventoryReserverInterface; +use Be\Pattern\OrderProcessing\Reason\PaymentGateway; +use Be\Pattern\OrderProcessing\Reason\PaymentGatewayInterface; +use Be\Pattern\OrderProcessing\Reason\ShippingArranger; +use Be\Pattern\OrderProcessing\Reason\ShippingArrangerInterface; +use Be\Pattern\OrderProcessing\Reason\WarehouseLocator; use Ray\Di\AbstractModule; final class AppModule extends AbstractModule diff --git a/demos/order-processing/src/Moment/InventoryReserved.php b/demos/order-processing/src/Moment/InventoryReserved.php index 2855dbb..89f3d4d 100644 --- a/demos/order-processing/src/Moment/InventoryReserved.php +++ b/demos/order-processing/src/Moment/InventoryReserved.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Be\App\Moment; +namespace Be\Pattern\OrderProcessing\Moment; -use Be\App\Attribute\ProductId; -use Be\App\Attribute\Quantity; -use Be\App\Attribute\WarehouseId; -use Be\App\Moment\Potential\InventoryReservation; -use Be\App\Reason\InventoryReserverInterface; +use Be\Pattern\OrderProcessing\Attribute\ProductId; +use Be\Pattern\OrderProcessing\Attribute\Quantity; +use Be\Pattern\OrderProcessing\Attribute\WarehouseId; +use Be\Pattern\OrderProcessing\Moment\Potential\InventoryReservation; +use Be\Pattern\OrderProcessing\Reason\InventoryReserverInterface; use Ray\Di\Di\Inject; /** diff --git a/demos/order-processing/src/Moment/MomentInterface.php b/demos/order-processing/src/Moment/MomentInterface.php index 90997b8..ccd02c1 100644 --- a/demos/order-processing/src/Moment/MomentInterface.php +++ b/demos/order-processing/src/Moment/MomentInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Moment; +namespace Be\Pattern\OrderProcessing\Moment; /** * Moment - Potential waiting to be realized diff --git a/demos/order-processing/src/Moment/PaymentCompleted.php b/demos/order-processing/src/Moment/PaymentCompleted.php index 4830b3c..16fa699 100644 --- a/demos/order-processing/src/Moment/PaymentCompleted.php +++ b/demos/order-processing/src/Moment/PaymentCompleted.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Be\App\Moment; +namespace Be\Pattern\OrderProcessing\Moment; -use Be\App\Attribute\Amount; -use Be\App\Attribute\CardNumber; -use Be\App\Moment\Potential\PaymentCapture; -use Be\App\Reason\PaymentGatewayInterface; +use Be\Pattern\OrderProcessing\Attribute\Amount; +use Be\Pattern\OrderProcessing\Attribute\CardNumber; +use Be\Pattern\OrderProcessing\Moment\Potential\PaymentCapture; +use Be\Pattern\OrderProcessing\Reason\PaymentGatewayInterface; use Ray\Di\Di\Inject; /** diff --git a/demos/order-processing/src/Moment/Potential/InventoryReservation.php b/demos/order-processing/src/Moment/Potential/InventoryReservation.php index c58406a..397b397 100644 --- a/demos/order-processing/src/Moment/Potential/InventoryReservation.php +++ b/demos/order-processing/src/Moment/Potential/InventoryReservation.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Moment\Potential; +namespace Be\Pattern\OrderProcessing\Moment\Potential; -use Be\App\Moment\MomentInterface; +use Be\Pattern\OrderProcessing\Moment\MomentInterface; /** * Inventory Reservation - potential to confirm inventory hold diff --git a/demos/order-processing/src/Moment/Potential/PaymentCapture.php b/demos/order-processing/src/Moment/Potential/PaymentCapture.php index cf57ee0..53c8a2a 100644 --- a/demos/order-processing/src/Moment/Potential/PaymentCapture.php +++ b/demos/order-processing/src/Moment/Potential/PaymentCapture.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Moment\Potential; +namespace Be\Pattern\OrderProcessing\Moment\Potential; -use Be\App\Moment\MomentInterface; +use Be\Pattern\OrderProcessing\Moment\MomentInterface; /** * Payment Capture - potential to capture authorized payment diff --git a/demos/order-processing/src/Moment/Potential/ShippingDispatch.php b/demos/order-processing/src/Moment/Potential/ShippingDispatch.php index b6325ee..c5bf1f7 100644 --- a/demos/order-processing/src/Moment/Potential/ShippingDispatch.php +++ b/demos/order-processing/src/Moment/Potential/ShippingDispatch.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Moment\Potential; +namespace Be\Pattern\OrderProcessing\Moment\Potential; -use Be\App\Moment\MomentInterface; +use Be\Pattern\OrderProcessing\Moment\MomentInterface; /** * Shipping Dispatch - potential to dispatch shipment diff --git a/demos/order-processing/src/Moment/ShippingArranged.php b/demos/order-processing/src/Moment/ShippingArranged.php index 9221f8b..c3e25b8 100644 --- a/demos/order-processing/src/Moment/ShippingArranged.php +++ b/demos/order-processing/src/Moment/ShippingArranged.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Be\App\Moment; +namespace Be\Pattern\OrderProcessing\Moment; -use Be\App\Attribute\Address; -use Be\App\Attribute\CarrierId; -use Be\App\Moment\Potential\ShippingDispatch; -use Be\App\Reason\ShippingArrangerInterface; +use Be\Pattern\OrderProcessing\Attribute\Address; +use Be\Pattern\OrderProcessing\Attribute\CarrierId; +use Be\Pattern\OrderProcessing\Moment\Potential\ShippingDispatch; +use Be\Pattern\OrderProcessing\Reason\ShippingArrangerInterface; use Ray\Di\Di\Inject; /** diff --git a/demos/order-processing/src/Reason/AddressValidator.php b/demos/order-processing/src/Reason/AddressValidator.php index 81924b3..f01d03a 100644 --- a/demos/order-processing/src/Reason/AddressValidator.php +++ b/demos/order-processing/src/Reason/AddressValidator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; /** * Address Validator - Reason for address validation diff --git a/demos/order-processing/src/Reason/CardValidator.php b/demos/order-processing/src/Reason/CardValidator.php index e36cc05..20519e6 100644 --- a/demos/order-processing/src/Reason/CardValidator.php +++ b/demos/order-processing/src/Reason/CardValidator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; /** * Card Validator - Reason for card validation diff --git a/demos/order-processing/src/Reason/CarrierSelector.php b/demos/order-processing/src/Reason/CarrierSelector.php index 10aaff4..ee6d9e3 100644 --- a/demos/order-processing/src/Reason/CarrierSelector.php +++ b/demos/order-processing/src/Reason/CarrierSelector.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; /** * Carrier Selector - Reason for carrier selection diff --git a/demos/order-processing/src/Reason/InventoryChecker.php b/demos/order-processing/src/Reason/InventoryChecker.php index 7e552db..72a7c95 100644 --- a/demos/order-processing/src/Reason/InventoryChecker.php +++ b/demos/order-processing/src/Reason/InventoryChecker.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; /** * Inventory Checker - Reason for quantity verification diff --git a/demos/order-processing/src/Reason/InventoryReserver.php b/demos/order-processing/src/Reason/InventoryReserver.php index 68a3fad..7300069 100644 --- a/demos/order-processing/src/Reason/InventoryReserver.php +++ b/demos/order-processing/src/Reason/InventoryReserver.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; -use Be\App\Moment\Potential\InventoryReservation; +use Be\Pattern\OrderProcessing\Moment\Potential\InventoryReservation; /** * Inventory Reserver - Reason (stateless gateway) diff --git a/demos/order-processing/src/Reason/InventoryReserverInterface.php b/demos/order-processing/src/Reason/InventoryReserverInterface.php index 02d78a4..eccff5f 100644 --- a/demos/order-processing/src/Reason/InventoryReserverInterface.php +++ b/demos/order-processing/src/Reason/InventoryReserverInterface.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; -use Be\App\Moment\Potential\InventoryReservation; +use Be\Pattern\OrderProcessing\Moment\Potential\InventoryReservation; /** * Inventory Reserver Interface diff --git a/demos/order-processing/src/Reason/PaymentGateway.php b/demos/order-processing/src/Reason/PaymentGateway.php index 9d0cfd8..96859ba 100644 --- a/demos/order-processing/src/Reason/PaymentGateway.php +++ b/demos/order-processing/src/Reason/PaymentGateway.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; -use Be\App\Moment\Potential\PaymentCapture; +use Be\Pattern\OrderProcessing\Moment\Potential\PaymentCapture; /** * Payment Gateway - Reason (stateless gateway) diff --git a/demos/order-processing/src/Reason/PaymentGatewayInterface.php b/demos/order-processing/src/Reason/PaymentGatewayInterface.php index 0d24d63..735b7d2 100644 --- a/demos/order-processing/src/Reason/PaymentGatewayInterface.php +++ b/demos/order-processing/src/Reason/PaymentGatewayInterface.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; -use Be\App\Moment\Potential\PaymentCapture; +use Be\Pattern\OrderProcessing\Moment\Potential\PaymentCapture; /** * Payment Gateway Interface diff --git a/demos/order-processing/src/Reason/ShippingArranger.php b/demos/order-processing/src/Reason/ShippingArranger.php index 51ca3b3..3795d00 100644 --- a/demos/order-processing/src/Reason/ShippingArranger.php +++ b/demos/order-processing/src/Reason/ShippingArranger.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; -use Be\App\Moment\Potential\ShippingDispatch; +use Be\Pattern\OrderProcessing\Moment\Potential\ShippingDispatch; /** * Shipping Arranger - Reason (stateless gateway) diff --git a/demos/order-processing/src/Reason/ShippingArrangerInterface.php b/demos/order-processing/src/Reason/ShippingArrangerInterface.php index 4e8a265..3c6c86d 100644 --- a/demos/order-processing/src/Reason/ShippingArrangerInterface.php +++ b/demos/order-processing/src/Reason/ShippingArrangerInterface.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; -use Be\App\Moment\Potential\ShippingDispatch; +use Be\Pattern\OrderProcessing\Moment\Potential\ShippingDispatch; /** * Shipping Arranger Interface diff --git a/demos/order-processing/src/Reason/WarehouseLocator.php b/demos/order-processing/src/Reason/WarehouseLocator.php index 3438503..e460983 100644 --- a/demos/order-processing/src/Reason/WarehouseLocator.php +++ b/demos/order-processing/src/Reason/WarehouseLocator.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\App\Reason; +namespace Be\Pattern\OrderProcessing\Reason; /** * Warehouse Locator - Reason for stock location diff --git a/demos/order-processing/src/Semantic/Amount.php b/demos/order-processing/src/Semantic/Amount.php index fe54ce3..b6df020 100644 --- a/demos/order-processing/src/Semantic/Amount.php +++ b/demos/order-processing/src/Semantic/Amount.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; -use Be\App\Exception\InvalidAmountException; +use Be\Pattern\OrderProcessing\Exception\InvalidAmountException; use Be\Framework\Attribute\Validate; /** diff --git a/demos/order-processing/src/Semantic/CardCvv.php b/demos/order-processing/src/Semantic/CardCvv.php index 62f2f2d..aa3b329 100644 --- a/demos/order-processing/src/Semantic/CardCvv.php +++ b/demos/order-processing/src/Semantic/CardCvv.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; -use Be\App\Exception\InvalidCardCvvException; +use Be\Pattern\OrderProcessing\Exception\InvalidCardCvvException; use Be\Framework\Attribute\Validate; /** diff --git a/demos/order-processing/src/Semantic/CardExpiry.php b/demos/order-processing/src/Semantic/CardExpiry.php index 9a75594..01f3cf1 100644 --- a/demos/order-processing/src/Semantic/CardExpiry.php +++ b/demos/order-processing/src/Semantic/CardExpiry.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; -use Be\App\Exception\InvalidCardExpiryException; +use Be\Pattern\OrderProcessing\Exception\InvalidCardExpiryException; use Be\Framework\Attribute\Validate; /** diff --git a/demos/order-processing/src/Semantic/CardNumber.php b/demos/order-processing/src/Semantic/CardNumber.php index 3d534ce..97eb11c 100644 --- a/demos/order-processing/src/Semantic/CardNumber.php +++ b/demos/order-processing/src/Semantic/CardNumber.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; use Be\Framework\Attribute\Validate; -use Be\App\Exception\InvalidCardNumberException; +use Be\Pattern\OrderProcessing\Exception\InvalidCardNumberException; /** * Card Number diff --git a/demos/order-processing/src/Semantic/CartId.php b/demos/order-processing/src/Semantic/CartId.php index 4894e31..5c45693 100644 --- a/demos/order-processing/src/Semantic/CartId.php +++ b/demos/order-processing/src/Semantic/CartId.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; -use Be\App\Exception\InvalidCartIdException; +use Be\Pattern\OrderProcessing\Exception\InvalidCartIdException; use Be\Framework\Attribute\Validate; /** diff --git a/demos/order-processing/src/Semantic/CustomerId.php b/demos/order-processing/src/Semantic/CustomerId.php index 88bd6b8..2f65f10 100644 --- a/demos/order-processing/src/Semantic/CustomerId.php +++ b/demos/order-processing/src/Semantic/CustomerId.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; -use Be\App\Exception\InvalidCustomerIdException; +use Be\Pattern\OrderProcessing\Exception\InvalidCustomerIdException; use Be\Framework\Attribute\Validate; /** diff --git a/demos/order-processing/src/Semantic/Name.php b/demos/order-processing/src/Semantic/Name.php index 2a93b27..1eacfe1 100644 --- a/demos/order-processing/src/Semantic/Name.php +++ b/demos/order-processing/src/Semantic/Name.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; use Be\Framework\Attribute\Validate; -use Be\App\Exception\EmptyNameException; +use Be\Pattern\OrderProcessing\Exception\EmptyNameException; use function trim; /** diff --git a/demos/order-processing/src/Semantic/PostalCode.php b/demos/order-processing/src/Semantic/PostalCode.php index 04d8883..d202d33 100644 --- a/demos/order-processing/src/Semantic/PostalCode.php +++ b/demos/order-processing/src/Semantic/PostalCode.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; use Be\Framework\Attribute\Validate; -use Be\App\Exception\InvalidPostalCodeException; +use Be\Pattern\OrderProcessing\Exception\InvalidPostalCodeException; /** * Postal Code diff --git a/demos/order-processing/src/Semantic/ProductId.php b/demos/order-processing/src/Semantic/ProductId.php index 6ade35b..69be909 100644 --- a/demos/order-processing/src/Semantic/ProductId.php +++ b/demos/order-processing/src/Semantic/ProductId.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; -use Be\App\Exception\InvalidProductIdException; +use Be\Pattern\OrderProcessing\Exception\InvalidProductIdException; use Be\Framework\Attribute\Validate; /** diff --git a/demos/order-processing/src/Semantic/Quantity.php b/demos/order-processing/src/Semantic/Quantity.php index 2da1ecf..8dc095c 100644 --- a/demos/order-processing/src/Semantic/Quantity.php +++ b/demos/order-processing/src/Semantic/Quantity.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; use Be\Framework\Attribute\Validate; -use Be\App\Exception\InvalidQuantityException; +use Be\Pattern\OrderProcessing\Exception\InvalidQuantityException; /** * Quantity diff --git a/demos/order-processing/src/Semantic/StreetAddress.php b/demos/order-processing/src/Semantic/StreetAddress.php index f8efb94..e65aa6e 100644 --- a/demos/order-processing/src/Semantic/StreetAddress.php +++ b/demos/order-processing/src/Semantic/StreetAddress.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; -use Be\App\Exception\InvalidStreetAddressException; +use Be\Pattern\OrderProcessing\Exception\InvalidStreetAddressException; use Be\Framework\Attribute\Validate; /** diff --git a/demos/order-processing/src/Semantic/WarehouseId.php b/demos/order-processing/src/Semantic/WarehouseId.php index 3c262a4..5da985a 100644 --- a/demos/order-processing/src/Semantic/WarehouseId.php +++ b/demos/order-processing/src/Semantic/WarehouseId.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Semantic; +namespace Be\Pattern\OrderProcessing\Semantic; -use Be\App\Exception\InvalidWarehouseIdException; +use Be\Pattern\OrderProcessing\Exception\InvalidWarehouseIdException; use Be\Framework\Attribute\Validate; /** diff --git a/demos/order-processing/tests/Becoming/OrderBecomingTest.php b/demos/order-processing/tests/Becoming/OrderBecomingTest.php index ea1b282..21a4714 100644 --- a/demos/order-processing/tests/Becoming/OrderBecomingTest.php +++ b/demos/order-processing/tests/Becoming/OrderBecomingTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Be\App\Tests\Becoming; +namespace Be\Pattern\OrderProcessing\Tests\Becoming; -use Be\App\Final\OrderConfirmed; -use Be\App\Input\OrderInput; -use Be\App\Module\AppModule; +use Be\Pattern\OrderProcessing\Final\OrderConfirmed; +use Be\Pattern\OrderProcessing\Input\OrderInput; +use Be\Pattern\OrderProcessing\Module\AppModule; use Be\Framework\Becoming; use PHPUnit\Framework\TestCase; use Ray\Di\Injector; diff --git a/demos/order-processing/tests/Being/Inventory/QuantityCheckedTest.php b/demos/order-processing/tests/Being/Inventory/QuantityCheckedTest.php index 7360f33..5153510 100644 --- a/demos/order-processing/tests/Being/Inventory/QuantityCheckedTest.php +++ b/demos/order-processing/tests/Being/Inventory/QuantityCheckedTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Being\Inventory; +namespace Be\Pattern\OrderProcessing\Tests\Being\Inventory; -use Be\App\Being\Inventory\QuantityChecked; -use Be\App\Reason\InventoryChecker; +use Be\Pattern\OrderProcessing\Being\Inventory\QuantityChecked; +use Be\Pattern\OrderProcessing\Reason\InventoryChecker; use PHPUnit\Framework\TestCase; class QuantityCheckedTest extends TestCase diff --git a/demos/order-processing/tests/Being/Inventory/StockLocatedTest.php b/demos/order-processing/tests/Being/Inventory/StockLocatedTest.php index a887c2b..617396e 100644 --- a/demos/order-processing/tests/Being/Inventory/StockLocatedTest.php +++ b/demos/order-processing/tests/Being/Inventory/StockLocatedTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Being\Inventory; +namespace Be\Pattern\OrderProcessing\Tests\Being\Inventory; -use Be\App\Being\Inventory\StockLocated; -use Be\App\Reason\WarehouseLocator; +use Be\Pattern\OrderProcessing\Being\Inventory\StockLocated; +use Be\Pattern\OrderProcessing\Reason\WarehouseLocator; use PHPUnit\Framework\TestCase; class StockLocatedTest extends TestCase diff --git a/demos/order-processing/tests/Being/Payment/CardValidatedTest.php b/demos/order-processing/tests/Being/Payment/CardValidatedTest.php index d2eafb2..775cd35 100644 --- a/demos/order-processing/tests/Being/Payment/CardValidatedTest.php +++ b/demos/order-processing/tests/Being/Payment/CardValidatedTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Being\Payment; +namespace Be\Pattern\OrderProcessing\Tests\Being\Payment; -use Be\App\Being\Payment\CardValidated; -use Be\App\Reason\CardValidator; +use Be\Pattern\OrderProcessing\Being\Payment\CardValidated; +use Be\Pattern\OrderProcessing\Reason\CardValidator; use PHPUnit\Framework\TestCase; class CardValidatedTest extends TestCase diff --git a/demos/order-processing/tests/Being/Payment/PaymentAuthorizedTest.php b/demos/order-processing/tests/Being/Payment/PaymentAuthorizedTest.php index 54b6441..2ef0e15 100644 --- a/demos/order-processing/tests/Being/Payment/PaymentAuthorizedTest.php +++ b/demos/order-processing/tests/Being/Payment/PaymentAuthorizedTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Be\App\Tests\Being\Payment; +namespace Be\Pattern\OrderProcessing\Tests\Being\Payment; -use Be\App\Being\Payment\PaymentAuthorized; -use Be\App\Moment\Potential\PaymentCapture; -use Be\App\Reason\PaymentGateway; +use Be\Pattern\OrderProcessing\Being\Payment\PaymentAuthorized; +use Be\Pattern\OrderProcessing\Moment\Potential\PaymentCapture; +use Be\Pattern\OrderProcessing\Reason\PaymentGateway; use PHPUnit\Framework\TestCase; class PaymentAuthorizedTest extends TestCase diff --git a/demos/order-processing/tests/Being/Shipping/AddressValidatedTest.php b/demos/order-processing/tests/Being/Shipping/AddressValidatedTest.php index 2079d26..7a12f2f 100644 --- a/demos/order-processing/tests/Being/Shipping/AddressValidatedTest.php +++ b/demos/order-processing/tests/Being/Shipping/AddressValidatedTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Being\Shipping; +namespace Be\Pattern\OrderProcessing\Tests\Being\Shipping; -use Be\App\Being\Shipping\AddressValidated; -use Be\App\Reason\AddressValidator; +use Be\Pattern\OrderProcessing\Being\Shipping\AddressValidated; +use Be\Pattern\OrderProcessing\Reason\AddressValidator; use PHPUnit\Framework\TestCase; class AddressValidatedTest extends TestCase diff --git a/demos/order-processing/tests/Being/Shipping/CarrierSelectedTest.php b/demos/order-processing/tests/Being/Shipping/CarrierSelectedTest.php index 1fa0da3..28e4467 100644 --- a/demos/order-processing/tests/Being/Shipping/CarrierSelectedTest.php +++ b/demos/order-processing/tests/Being/Shipping/CarrierSelectedTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Being\Shipping; +namespace Be\Pattern\OrderProcessing\Tests\Being\Shipping; -use Be\App\Being\Shipping\CarrierSelected; -use Be\App\Reason\CarrierSelector; +use Be\Pattern\OrderProcessing\Being\Shipping\CarrierSelected; +use Be\Pattern\OrderProcessing\Reason\CarrierSelector; use PHPUnit\Framework\TestCase; class CarrierSelectedTest extends TestCase diff --git a/demos/order-processing/tests/Final/OrderConfirmedTest.php b/demos/order-processing/tests/Final/OrderConfirmedTest.php index 28e7e00..c48b04c 100644 --- a/demos/order-processing/tests/Final/OrderConfirmedTest.php +++ b/demos/order-processing/tests/Final/OrderConfirmedTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Be\App\Tests\Final; - -use Be\App\Final\OrderConfirmed; -use Be\App\Moment\InventoryReserved; -use Be\App\Moment\PaymentCompleted; -use Be\App\Moment\ShippingArranged; -use Be\App\Reason\InventoryReserver; -use Be\App\Reason\PaymentGateway; -use Be\App\Reason\ShippingArranger; +namespace Be\Pattern\OrderProcessing\Tests\Final; + +use Be\Pattern\OrderProcessing\Final\OrderConfirmed; +use Be\Pattern\OrderProcessing\Moment\InventoryReserved; +use Be\Pattern\OrderProcessing\Moment\PaymentCompleted; +use Be\Pattern\OrderProcessing\Moment\ShippingArranged; +use Be\Pattern\OrderProcessing\Reason\InventoryReserver; +use Be\Pattern\OrderProcessing\Reason\PaymentGateway; +use Be\Pattern\OrderProcessing\Reason\ShippingArranger; use PHPUnit\Framework\TestCase; class OrderConfirmedTest extends TestCase diff --git a/demos/order-processing/tests/Moment/InventoryReservedTest.php b/demos/order-processing/tests/Moment/InventoryReservedTest.php index 283f7c5..d58f72f 100644 --- a/demos/order-processing/tests/Moment/InventoryReservedTest.php +++ b/demos/order-processing/tests/Moment/InventoryReservedTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Moment; +namespace Be\Pattern\OrderProcessing\Tests\Moment; -use Be\App\Moment\InventoryReserved; -use Be\App\Reason\InventoryReserver; +use Be\Pattern\OrderProcessing\Moment\InventoryReserved; +use Be\Pattern\OrderProcessing\Reason\InventoryReserver; use PHPUnit\Framework\TestCase; class InventoryReservedTest extends TestCase diff --git a/demos/order-processing/tests/Moment/PaymentCompletedTest.php b/demos/order-processing/tests/Moment/PaymentCompletedTest.php index bf577ef..3e64148 100644 --- a/demos/order-processing/tests/Moment/PaymentCompletedTest.php +++ b/demos/order-processing/tests/Moment/PaymentCompletedTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Moment; +namespace Be\Pattern\OrderProcessing\Tests\Moment; -use Be\App\Moment\PaymentCompleted; -use Be\App\Reason\PaymentGateway; +use Be\Pattern\OrderProcessing\Moment\PaymentCompleted; +use Be\Pattern\OrderProcessing\Reason\PaymentGateway; use PHPUnit\Framework\TestCase; class PaymentCompletedTest extends TestCase diff --git a/demos/order-processing/tests/Moment/ShippingArrangedTest.php b/demos/order-processing/tests/Moment/ShippingArrangedTest.php index 69686f5..3d3583f 100644 --- a/demos/order-processing/tests/Moment/ShippingArrangedTest.php +++ b/demos/order-processing/tests/Moment/ShippingArrangedTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Moment; +namespace Be\Pattern\OrderProcessing\Tests\Moment; -use Be\App\Moment\ShippingArranged; -use Be\App\Reason\ShippingArranger; +use Be\Pattern\OrderProcessing\Moment\ShippingArranged; +use Be\Pattern\OrderProcessing\Reason\ShippingArranger; use PHPUnit\Framework\TestCase; class ShippingArrangedTest extends TestCase diff --git a/demos/order-processing/tests/Reason/AddressValidatorTest.php b/demos/order-processing/tests/Reason/AddressValidatorTest.php index 1168169..b3be459 100644 --- a/demos/order-processing/tests/Reason/AddressValidatorTest.php +++ b/demos/order-processing/tests/Reason/AddressValidatorTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Tests\Reason; +namespace Be\Pattern\OrderProcessing\Tests\Reason; -use Be\App\Reason\AddressValidator; +use Be\Pattern\OrderProcessing\Reason\AddressValidator; use PHPUnit\Framework\TestCase; class AddressValidatorTest extends TestCase diff --git a/demos/order-processing/tests/Reason/CardValidatorTest.php b/demos/order-processing/tests/Reason/CardValidatorTest.php index 92a054e..ab56653 100644 --- a/demos/order-processing/tests/Reason/CardValidatorTest.php +++ b/demos/order-processing/tests/Reason/CardValidatorTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Tests\Reason; +namespace Be\Pattern\OrderProcessing\Tests\Reason; -use Be\App\Reason\CardValidator; +use Be\Pattern\OrderProcessing\Reason\CardValidator; use PHPUnit\Framework\TestCase; class CardValidatorTest extends TestCase diff --git a/demos/order-processing/tests/Reason/CarrierSelectorTest.php b/demos/order-processing/tests/Reason/CarrierSelectorTest.php index f7157a2..7afbebe 100644 --- a/demos/order-processing/tests/Reason/CarrierSelectorTest.php +++ b/demos/order-processing/tests/Reason/CarrierSelectorTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Tests\Reason; +namespace Be\Pattern\OrderProcessing\Tests\Reason; -use Be\App\Reason\CarrierSelector; +use Be\Pattern\OrderProcessing\Reason\CarrierSelector; use PHPUnit\Framework\TestCase; class CarrierSelectorTest extends TestCase diff --git a/demos/order-processing/tests/Reason/InventoryCheckerTest.php b/demos/order-processing/tests/Reason/InventoryCheckerTest.php index b2ab248..12b7e60 100644 --- a/demos/order-processing/tests/Reason/InventoryCheckerTest.php +++ b/demos/order-processing/tests/Reason/InventoryCheckerTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Tests\Reason; +namespace Be\Pattern\OrderProcessing\Tests\Reason; -use Be\App\Reason\InventoryChecker; +use Be\Pattern\OrderProcessing\Reason\InventoryChecker; use PHPUnit\Framework\TestCase; class InventoryCheckerTest extends TestCase diff --git a/demos/order-processing/tests/Reason/InventoryReserverTest.php b/demos/order-processing/tests/Reason/InventoryReserverTest.php index 0ae4b3a..69f42b8 100644 --- a/demos/order-processing/tests/Reason/InventoryReserverTest.php +++ b/demos/order-processing/tests/Reason/InventoryReserverTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Reason; +namespace Be\Pattern\OrderProcessing\Tests\Reason; -use Be\App\Moment\Potential\InventoryReservation; -use Be\App\Reason\InventoryReserver; +use Be\Pattern\OrderProcessing\Moment\Potential\InventoryReservation; +use Be\Pattern\OrderProcessing\Reason\InventoryReserver; use PHPUnit\Framework\TestCase; class InventoryReserverTest extends TestCase diff --git a/demos/order-processing/tests/Reason/PaymentGatewayTest.php b/demos/order-processing/tests/Reason/PaymentGatewayTest.php index 1d66173..32282d9 100644 --- a/demos/order-processing/tests/Reason/PaymentGatewayTest.php +++ b/demos/order-processing/tests/Reason/PaymentGatewayTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Reason; +namespace Be\Pattern\OrderProcessing\Tests\Reason; -use Be\App\Moment\Potential\PaymentCapture; -use Be\App\Reason\PaymentGateway; +use Be\Pattern\OrderProcessing\Moment\Potential\PaymentCapture; +use Be\Pattern\OrderProcessing\Reason\PaymentGateway; use PHPUnit\Framework\TestCase; class PaymentGatewayTest extends TestCase diff --git a/demos/order-processing/tests/Reason/ShippingArrangerTest.php b/demos/order-processing/tests/Reason/ShippingArrangerTest.php index ee8c34b..9901ce6 100644 --- a/demos/order-processing/tests/Reason/ShippingArrangerTest.php +++ b/demos/order-processing/tests/Reason/ShippingArrangerTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Reason; +namespace Be\Pattern\OrderProcessing\Tests\Reason; -use Be\App\Moment\Potential\ShippingDispatch; -use Be\App\Reason\ShippingArranger; +use Be\Pattern\OrderProcessing\Moment\Potential\ShippingDispatch; +use Be\Pattern\OrderProcessing\Reason\ShippingArranger; use PHPUnit\Framework\TestCase; class ShippingArrangerTest extends TestCase diff --git a/demos/order-processing/tests/Reason/WarehouseLocatorTest.php b/demos/order-processing/tests/Reason/WarehouseLocatorTest.php index e935662..5fd91a7 100644 --- a/demos/order-processing/tests/Reason/WarehouseLocatorTest.php +++ b/demos/order-processing/tests/Reason/WarehouseLocatorTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Be\App\Tests\Reason; +namespace Be\Pattern\OrderProcessing\Tests\Reason; -use Be\App\Reason\WarehouseLocator; +use Be\Pattern\OrderProcessing\Reason\WarehouseLocator; use PHPUnit\Framework\TestCase; class WarehouseLocatorTest extends TestCase diff --git a/demos/order-processing/tests/Semantic/CardNumberTest.php b/demos/order-processing/tests/Semantic/CardNumberTest.php index 3e4ae30..8f2d5ae 100644 --- a/demos/order-processing/tests/Semantic/CardNumberTest.php +++ b/demos/order-processing/tests/Semantic/CardNumberTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Semantic; +namespace Be\Pattern\OrderProcessing\Tests\Semantic; -use Be\App\Semantic\CardNumber; -use Be\App\Exception\InvalidCardNumberException; +use Be\Pattern\OrderProcessing\Semantic\CardNumber; +use Be\Pattern\OrderProcessing\Exception\InvalidCardNumberException; use PHPUnit\Framework\TestCase; class CardNumberTest extends TestCase diff --git a/demos/order-processing/tests/Semantic/PostalCodeTest.php b/demos/order-processing/tests/Semantic/PostalCodeTest.php index 2b2574a..759ac47 100644 --- a/demos/order-processing/tests/Semantic/PostalCodeTest.php +++ b/demos/order-processing/tests/Semantic/PostalCodeTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Semantic; +namespace Be\Pattern\OrderProcessing\Tests\Semantic; -use Be\App\Semantic\PostalCode; -use Be\App\Exception\InvalidPostalCodeException; +use Be\Pattern\OrderProcessing\Semantic\PostalCode; +use Be\Pattern\OrderProcessing\Exception\InvalidPostalCodeException; use PHPUnit\Framework\TestCase; class PostalCodeTest extends TestCase diff --git a/demos/order-processing/tests/Semantic/QuantityTest.php b/demos/order-processing/tests/Semantic/QuantityTest.php index 9851df0..acd5174 100644 --- a/demos/order-processing/tests/Semantic/QuantityTest.php +++ b/demos/order-processing/tests/Semantic/QuantityTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Be\App\Tests\Semantic; +namespace Be\Pattern\OrderProcessing\Tests\Semantic; -use Be\App\Semantic\Quantity; -use Be\App\Exception\InvalidQuantityException; +use Be\Pattern\OrderProcessing\Semantic\Quantity; +use Be\Pattern\OrderProcessing\Exception\InvalidQuantityException; use PHPUnit\Framework\TestCase; class QuantityTest extends TestCase diff --git a/docs/templates/BeingTemplate.php b/docs/templates/BeingTemplate.php index 6a62dd9..799ac44 100644 --- a/docs/templates/BeingTemplate.php +++ b/docs/templates/BeingTemplate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\Pattern\Template\Being; // TODO: replace `Template` with the real demo name (or use Be\App\Being) +namespace Be\Pattern\Template\Being; // TODO: replace `Template` with the real demo name use Be\Framework\Attribute\Be; use Ray\Di\Di\Inject; diff --git a/docs/templates/FinalTemplate.php b/docs/templates/FinalTemplate.php index 94647b2..e60858a 100644 --- a/docs/templates/FinalTemplate.php +++ b/docs/templates/FinalTemplate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\Pattern\Template\Final; // TODO: replace `Template` with the real demo name (or use Be\App\Final) +namespace Be\Pattern\Template\Final; // TODO: replace `Template` with the real demo name use Ray\Di\Di\Inject; diff --git a/docs/templates/InputTemplate.php b/docs/templates/InputTemplate.php index 637e3f3..ea5604e 100644 --- a/docs/templates/InputTemplate.php +++ b/docs/templates/InputTemplate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\Pattern\Template\Input; // TODO: replace `Template` with the real demo name (or use Be\App\Input) +namespace Be\Pattern\Template\Input; // TODO: replace `Template` with the real demo name use Be\Framework\Attribute\Be; diff --git a/docs/templates/MomentTemplate.php b/docs/templates/MomentTemplate.php index 33f49db..b9e7a0c 100644 --- a/docs/templates/MomentTemplate.php +++ b/docs/templates/MomentTemplate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\Pattern\Template\Moment; // TODO: replace `Template` with the real demo name (or use Be\App\Moment) +namespace Be\Pattern\Template\Moment; // TODO: replace `Template` with the real demo name use Ray\Di\Di\Inject; use Ray\InputQuery\Attribute\Input; @@ -21,8 +21,8 @@ * Canonical example: demos/order-processing/src/Moment/InventoryReserved.php * * NOTE: MomentInterface is defined per-demo under its own namespace (e.g. - * `Be\App\Moment\MomentInterface`). Re-declare or import the appropriate - * one when you copy this template into a real demo. + * `Be\Pattern\OrderProcessing\Moment\MomentInterface`). Re-declare or import + * the appropriate one when you copy this template into a real demo. */ final readonly class MomentTemplate /* implements MomentInterface */ { diff --git a/docs/templates/README.md b/docs/templates/README.md index cad7e34..6ff6f15 100644 --- a/docs/templates/README.md +++ b/docs/templates/README.md @@ -10,11 +10,11 @@ assistants. > form `Be\Pattern\Template\;` so the file declares *some* namespace > while still mirroring the repo convention `Be\Pattern\\\…`. > **When you copy a template into a real demo you MUST replace `Template` -> with the actual demo name** (e.g. `Be\Pattern\OrderProcessing\Being\…`) or -> use the alternate `Be\App\\…` form, to comply with the rules in -> [`CLAUDE.md`](../../CLAUDE.md). Never leave the literal `Template` segment -> in committed code. Each template marks the line you must change with a -> `TODO` comment on the `namespace` declaration. +> with the actual demo name** (e.g. `Be\Pattern\OrderProcessing\Being\…`), +> to comply with the rules in [`CLAUDE.md`](../../CLAUDE.md). Never leave +> the literal `Template` segment in committed code. Each template marks +> the line you must change with a `TODO` comment on the `namespace` +> declaration. Each template: diff --git a/docs/templates/ReasonInterfaceTemplate.php b/docs/templates/ReasonInterfaceTemplate.php index 2333bea..19b3c63 100644 --- a/docs/templates/ReasonInterfaceTemplate.php +++ b/docs/templates/ReasonInterfaceTemplate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\Pattern\Template\Reason; // TODO: replace `Template` with the real demo name (or use Be\App\Reason) +namespace Be\Pattern\Template\Reason; // TODO: replace `Template` with the real demo name /** * Reason template (Sufficient Reason). diff --git a/docs/templates/SemanticTemplate.php b/docs/templates/SemanticTemplate.php index 713bf50..cc20053 100644 --- a/docs/templates/SemanticTemplate.php +++ b/docs/templates/SemanticTemplate.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Be\Pattern\Template\Semantic; // TODO: replace `Template` with the real demo name (or use Be\App\Semantic) +namespace Be\Pattern\Template\Semantic; // TODO: replace `Template` with the real demo name use Be\Framework\Attribute\Validate; From ef26f96582af28d1a03be6d3fc1bc207830c51da Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Fri, 17 Apr 2026 01:20:51 +0900 Subject: [PATCH 2/2] CLAUDE.md: align Section 5 templates wording with Be\Pattern\* invariant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stale reference to `namespace Be\Template;` contradicted the Be\Pattern\\\... invariant tightened in §3 and §9. Actual template files already use `Be\Pattern\Template\`; §5 now documents that shape. --- CLAUDE.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b14e130..04ca4dc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -118,9 +118,10 @@ will not run under Ray.Di or will break framework expectations. ## 5. Templates Copy-pasteable minimal skeletons for every layer live in -[`docs/templates/`](./docs/templates/). They are intentionally outside any -Composer autoload scope (`namespace Be\Template;`) so they do not pollute demo -class maps. +[`docs/templates/`](./docs/templates/). They are intentionally outside Composer +autoload scope and use placeholder namespaces of the form +`Be\Pattern\Template\;` — mirror that shape when copying a template into +a real demo (replace `Template` with the actual demo name). ---