Permalink
Browse files

建立 ShippingService 使用 interface

  • Loading branch information...
1 parent 9bfce79 commit 6eb814f4aeeca9a58a52db55c5465861e78569b8 Sam.IO.Hsiao committed Nov 18, 2016
Showing with 19 additions and 0 deletions.
  1. +19 −0 app/Services/ShippingService.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types = 1);
+
+namespace App\Services;
+
+class ShippingService
+{
+ /**
+ * 計算運費
+ * @param int $weight
+ * @param LogisticsInterface $logistics
+ * @return int
+ */
+ public function calculateFee(int $weight, LogisticsInterface $logistics) : int
+ {
+ return $logistics->calculateFee($weight);
+ }
+}

0 comments on commit 6eb814f

Please sign in to comment.