Last active
June 3, 2017 19:14
-
-
Save aguimaraes/1af92d1d70b6c72ac03c78ff4f53e0a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Domain; | |
class Checkout | |
{ | |
private $orderValidation; | |
private $orderRepo; | |
public function __construct(OrderValidation $orderValidation, OrderRepository $orderRepo) | |
{ | |
$this->orderValidation = $orderValidation; | |
$this->orderRepo = $orderRepo; | |
} | |
public function saveOrder(Order $order): Order | |
{ | |
$this->orderValidation->validate($order); | |
return $this->orderRepo->save($order); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment