-
Notifications
You must be signed in to change notification settings - Fork 2
Remove container dependency #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,6 @@ | |
|
||
interface ClientInterface | ||
{ | ||
/** | ||
* @return ContainerInterface | ||
*/ | ||
public function getContainer(): ContainerInterface; | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getFromContainer(string $id); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used in two clients and from I've gathered it can easily updated after this fix 👍 |
||
|
||
/** | ||
* @param $command | ||
* @return CancellablePromiseInterface | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,9 @@ public static function create( | |
LoopInterface $loop, | ||
array $options = [] | ||
): Client { | ||
$container = self::createContainer($loop, $options); | ||
return new Client( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we actually need this method? This factory should return the commandbus, not the client? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually returning the command bus instead of the client makes sense. Clients should using it building their client and abstract all operations into it 👍 . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ignore this comment for now. It would be something for a follow up PR, like to explore the idea though. |
||
self::createContainer($loop, $options) | ||
$container->get(CommandBusInterface::class) | ||
); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this, PHP-DI was specifically picked for the autowiring of dependencies for services and handlers used throughout the entire @php-api-clients project. External definitions are supported through https://github.com/php-api-clients/foundation/blob/master/src/Factory.php#L53 but I would like to support wrappoing an external PSR-11 container in the future.