The property restaurant_id does not exist on WagnerMontanini\GoomerApi\Models\Product. Since you implemented __get, consider adding a @property annotation.
$this->restaurant_id of type null|string is incompatible with the type integer expected by parameter $id of CoffeeCode\DataLayer\DataLayer::findById().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
29
$this->restaurant = (new Restaurant())->findById(/** @scrutinizer ignore-type */ $this->restaurant_id)->data();
Loading history...
30
return $this;
31
}
32
33
public function category(): Product
34
{
35
$this->category = (new ProductCategory())->findById($this->category_id)->data();
$this->category_id of type null|string is incompatible with the type integer expected by parameter $id of CoffeeCode\DataLayer\DataLayer::findById().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
35
$this->category = (new ProductCategory())->findById(/** @scrutinizer ignore-type */ $this->category_id)->data();
The property category_id does not exist on WagnerMontanini\GoomerApi\Models\Product. Since you implemented __get, consider adding a @property annotation.