From 91d837ee16d0da30c2d8f3425a4c68371e901819 Mon Sep 17 00:00:00 2001 From: CodeChari Date: Tue, 9 Mar 2021 13:42:54 +0530 Subject: [PATCH] Fix for Declaration , compatibility . Error: Declaration of app\models\Product::getPrice() must be compatible with yii2mod\cart\models\CartItemInterface::getPrice(): int return type should be defined to fix the incompatibility. Also, PHP version should be greater than 7 in the composer.json. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 41a6dc5..f921a9e 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,8 @@ return [ class ProductModel extends ActiveRecord implements CartItemInterface { - public function getPrice() +//requires php >= 7, declare version in composer.json + public function getPrice() : int { return $this->price; }