Created
May 6, 2019 23:41
Revisions
-
Ryuta Hamasaki created this gist
May 6, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php class OrderProcessor { public function __construct(array $validators, OrderNotificationInterface $notification) { $this->$validators = $validators; $this->notification = $notification; } public function process(Order $order) { foreach ($this->validators as $validator) { $validator->validate($order); } $order->update(); $this->notification->notify($order); } }