trait MyPrice
{
    private $taxrate = 15;

    public function CalculatePrice(float $price) : float
    {
        return ($price/100)*$this->taxrate;
    }
}

class ShopProduct
{
    use MyPrice;
}

$price = 50;
echo (new ShopProduct())->CalculatePrice($price);