public function setAverageUserRating($averageUserRating)
    {
        $averageUserRating = (float) $averageUserRating;

        if ($averageUserRating < 0 || $averageUserRating > 5) {
            throw new \InvalidArgumentException(sprintf(
                'Average user rating must be between 0 and 5, "%s" given.',
                $averageUserRating
            ));
        }

        if ($averageUserRating && fmod($averageUserRating, 0.5)) {
            throw new \InvalidArgumentException(sprintf(
                'Rating must be division by 0.5, "%s" given.',
                $averageUserRating
            ));
        }

        $this->averageUserRating = $averageUserRating;

        return $this;
    }
public function setAverageUserRating($averageUserRating)
    {
        $averageUserRating = (float) $averageUserRating;

        if ($averageUserRating < 0 || $averageUserRating > 5) {
            throw new \InvalidArgumentException(sprintf(
                'Average user rating must be between 0 and 5, "%s" given.',
                $averageUserRating
            ));
        }

        if ($averageUserRating && fmod($averageUserRating, 0.5)) {
            throw new \InvalidArgumentException(sprintf(
                'Rating must be division by 0.5, "%s" given.',
                $averageUserRating
            ));
        }

        $this->averageUserRating = $averageUserRating;

        return $this;
    }
public function setAverageUserRating ( $ averageUserRating ) { $ averageUserRating = ( float ) $ averageUserRating ; if ( $ averageUserRating < 0 || $ averageUserRating > 5 ) { throw new \ InvalidArgumentException ( sprintf ( 'Average user rating must be between 0 and 5, "%s" given.' , $ averageUserRating ) ) ; } if ( $ averageUserRating && fmod ( $ averageUserRating , 0.5 ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Rating must be division by 0.5, "%s" given.' , $ averageUserRating ) ) ; } $ this -> averageUserRating = $ averageUserRating ; return $ this ; }
Set user average rating

@param float $averageUserRating

@return Software

@throws \InvalidArgumentException
Set user average rating