-
Notifications
You must be signed in to change notification settings - Fork 256
Create a resolver API for picking a checkout flow #533
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
Create a resolver API for picking a checkout flow #533
Conversation
Failures are phpcs related |
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function addResolver(CheckoutFlowResolverInterface $resolver, $priority) { |
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.
Remove $priority
parameter, we removed this in HEAD
* {@inheritdoc} | ||
*/ | ||
public function addResolver(CheckoutFlowResolverInterface $resolver, $priority) { | ||
$this->resolvers[$priority] = $resolver; |
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.
s/[$priority]
/[]
} | ||
|
||
return $order->checkout_flow->entity; | ||
return $this->chainCheckoutFlowResolver->resolve($order); |
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.
This needs if ($order->checkout_flow->isEmpty()) {
* {@inheritdoc} | ||
*/ | ||
public function resolve(OrderInterface $order) { | ||
if ($order->checkout_flow->isEmpty()) { |
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.
Move check to heckoutOrderManager
68e6e5f
to
ac287b7
Compare
} | ||
|
||
public function __sleep() { | ||
return parent::__sleep(); // TODO: Change the autogenerated stub |
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.
This is going to be removed. But in debugging the __sleep
method of the parent is invoking \Drupal::service
which says that $container
is empty.
Re: https://www.drupal.org/node/2710989