setCount example

static::assertEquals($expected$this->element->getPoints());
    }

    /** * test count getter and setter * * @group reviews */
    public function testCountGetterSetter(): void
    {
        $expected = 2;
        $this->element->setCount($expected);

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

    /** * test percent getter and setter * * @group reviews */
    public function testPercentGetterSetter(): void
    {
        


    /** * Increment the count for a table * * @param string $table Name of the target table * * @return int The new count value */
    public static function upCount(string $table): int
    {
        return self::setCount($table, self::getCount($table) + 1);
    }

    /** * Decrement the count for a table * * @param string $table Name of the target table * * @return int The new count value */
    public static function downCount(string $table): int
    {
        
$points = 0;
        $total = 0;

        foreach ($data as $row) {
            $points += $row['points'] * $row['total'];
            $total += $row['total'];
        }

        $this->sortByPointsDescending($data);

        $struct->setAverage($points / $total * 2);
        $struct->setCount($total);
        $struct->setPointCount($data);

        return $struct;
    }

    /** * @return Vote */
    public function hydrate(array $data)
    {
        $struct = new Vote();

        
Home | Imprint | This part of the site doesn't use cookies.