Skip to content

Commit b9e83a8

Browse files
authored
Merge pull request #22 from binafy/fix-return-type-of-getprice-method
[1.x] Change return type of `getPrice`
2 parents a2b4e7c + fff9842 commit b9e83a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Cartable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
interface Cartable
66
{
7-
public function getPrice(): int;
7+
public function getPrice(): float;
88
}

tests/SetUp/Models/Product.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class Product extends Model implements Cartable
1717
/**
1818
* Get the correct price.
1919
*/
20-
public function getPrice(): int
20+
public function getPrice(): float
2121
{
22-
return $this->price;
22+
return (float) $this->price;
2323
}
2424
}

0 commit comments

Comments
 (0)