public function getGenerator()
    {
        if (!$this->generators) {
            $this->loadGenerators();
        }

        $generators = $this->generators;
        usort($generators, function ($a, $b) {
            return ($b::getPriority() - $a::getPriority());
        });

        $generator = null;
        if (isset ($generators[0])) {
            $class = $generators[0];
            $generator = new $class;
        }

        return $generator;
    }
public function getGenerator()
    {
        if (!$this->generators) {
            $this->loadGenerators();
        }

        $generators = $this->generators;
        usort($generators, function ($a, $b) {
            return ($b::getPriority() - $a::getPriority());
        });

        $generator = null;
        if (isset ($generators[0])) {
            $class = $generators[0];
            $generator = new $class;
        }

        return $generator;
    }
public function getGenerator ( ) { if ( ! $ this -> generators ) { $ this -> loadGenerators ( ) ; } $ generators = $ this -> generators ; usort ( $ generators , function ( $ a , $ b ) { return ( $ b :: getPriority ( ) - $ a :: getPriority ( ) ) ; } ) ; $ generator = null ; if ( isset ( $ generators [ 0 ] ) ) { $ class = $ generators [ 0 ] ; $ generator = new $ class ; } return $ generator ; }
Get a supported random data generator.

Checks the available supported generators and attempts to return the best
possible generator.

@return \Rych\Random\Generator\GeneratorInterface
@uses \Rych\Random\Generator\GeneratorInterface::getPriority() Used to
sort the available generators from lowest to highest priority.
Get a supported random data generator .