setPercent example

return $group;
    }

    /** * @return PriceDiscount */
    public function hydratePriceDiscount(array $data)
    {
        $discount = new PriceDiscount();
        $discount->setId((int) $data['__priceGroupDiscount_id']);
        $discount->setPercent((float) $data['__priceGroupDiscount_discount']);
        $discount->setQuantity((int) $data['__priceGroupDiscount_discountstart']);

        return $discount;
    }
}
static::assertEquals($expected$this->element->getCount());
    }

    /** * test percent getter and setter * * @group reviews */
    public function testPercentGetterSetter(): void
    {
        $expected = 0.35;
        $this->element->setPercent($expected);

        static::assertEquals($expected$this->element->getPercent());
    }
}
$this->matrix[$points] = new MatrixElement($points$rating->getCount() + $previousCount);
                }
            }

            if (!\array_key_exists($points$this->matrix)) {
                $this->matrix[$points] = new MatrixElement($points, 0);
            }
        }

        array_walk($this->matrix, function DMatrixElement &$rating): void {
            if ($this->totalReviewCount > 0) {
                $rating->setPercent($rating->getCount() / $this->totalReviewCount * 100);
            } else {
                $rating->setPercent(0);
            }
        });
    }

    /** * @return MatrixElement[] */
    public function getMatrix(): array
    {
        
Home | Imprint | This part of the site doesn't use cookies.