Comments (2)
if (!$handledStamps) {
// async command
return null;
}
Note that still a normal sync command must meet a handler. By removing the logic exception you'll miss that rule.
The alternative to allow async without losing the sync validation would be:
if (!$handledStamps) {
if ($envelope->all(SentStamp::class)) {
// async command
return null;
}
throw new LogicException(sprintf('Message of type "%s" was handled zero times. Exactly one handler is expected when using "%s::%s()".', get_debug_type($envelope->getMessage()), static::class, __FUNCTION__));
}
Checking by SentStamp::class
you'll know that the command was at least sent through an async transport.
from apip-ddd.
Thank you for your response 👍 However my problem described above is about PHPStan and generics :)
Note that still a normal sync command must meet a handler. By removing the logic exception you'll miss that rule.
I believe allow_no_handlers: false
in the bus configuration (this is a default in SF Messenger) will take care of that.
from apip-ddd.
Related Issues (17)
- Upgrade to the last version of APIP 2.7.0-alpha.2 HOT 5
- Add some tests
- Question about hydra context HOT 1
- Update documentation to fit with the new architecture
- Questions on best practice example HOT 3
- Cannot initialize readonly property AggregateRootId:: :$value from scope BookId HOT 7
- Best practices to work with relations in Api Platform 3 and DDD HOT 7
- Error during parsing: unrecognized protocol option 'experimental_http3' HOT 2
- Typo in shared services definition for kernel path HOT 2
- Repository pattern HOT 8
- Stuck make install HOT 2
- Collection operations not ACID complient HOT 2
- Doctrine et Vendor dans le Domain ? HOT 3
- Doctrine and Vendor in the Domain? HOT 1
- Wrong count with DoctrineRepository HOT 1
- MIT license in composer.json instead of proprietary HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apip-ddd.