src/Feature/RatioFeature.php
protected function getRatioStatus()
    {
        if ($this->ratio == 0.0) {
            return Status::INACTIVE;
        }

        if ($this->ratio >= 1.0) {
            return Status::ACTIVE;
        }

        $value = unpack('nint', md5((string)$this->varyValue, true))['int'];
        $filter = (int)floor(self::RESOLUTION * (float)$this->ratio);

        return ($value < $filter);
    }
protected function getRatioStatus()
    {
        if ($this->ratio == 0.0) {
            return Status::INACTIVE;
        }

        if ($this->ratio >= 1.0) {
            return Status::ACTIVE;
        }

        $value = unpack('nint', md5((string)$this->varyValue, true))['int'];
        $filter = (int)floor(self::RESOLUTION * (float)$this->ratio);

        return ($value < $filter);
    }
protected function getRatioStatus ( ) { if ( $ this -> ratio == 0.0 ) { return Status :: INACTIVE ; } if ( $ this -> ratio >= 1.0 ) { return Status :: ACTIVE ; } $ value = unpack ( 'nint' , md5 ( ( string ) $ this -> varyValue , true ) ) [ 'int' ] ; $ filter = ( int ) floor ( self :: RESOLUTION * ( float ) $ this -> ratio ) ; return ( $ value < $ filter ) ; }
Gets whether the feature is enabled according to the ratio alone

A RatioFeature can be enabled and disabled like any other feature. Only when it
is enabled, with a ratio above 0, does the ratio actually come into play.

We assume 0 <= $this->varyValue <= self::RESOLUTION when entering, uniformly
distributed.

@return boolean|null
Gets whether the feature is enabled according to the ratio alone