src/Dropbox/Security/RandomStringGeneratorFactory.php
public static function makeRandomStringGenerator($generator = null)
    {
        //No generator provided
        if (is_null($generator)) {
            //Generate default random string generator
            return static::defaultRandomStringGenerator();
        }

        //RandomStringGeneratorInterface
        if ($generator instanceof RandomStringGeneratorInterface) {
            return $generator;
        }

        // Mcrypt
        if ('mcrypt' === $generator) {
            return new McryptRandomStringGenerator();
        }

        //OpenSSL
        if ('openssl' === $generator) {
            return new OpenSslRandomStringGenerator();
        }

        //Invalid Argument
        throw new InvalidArgumentException('The random string generator must be set to "mcrypt", "openssl" or be an instance of Kunnu\Dropbox\Security\RandomStringGeneratorInterface');
    }
public static function makeRandomStringGenerator($generator = null)
    {
        //No generator provided
        if (is_null($generator)) {
            //Generate default random string generator
            return static::defaultRandomStringGenerator();
        }

        //RandomStringGeneratorInterface
        if ($generator instanceof RandomStringGeneratorInterface) {
            return $generator;
        }

        // Mcrypt
        if ('mcrypt' === $generator) {
            return new McryptRandomStringGenerator();
        }

        //OpenSSL
        if ('openssl' === $generator) {
            return new OpenSslRandomStringGenerator();
        }

        //Invalid Argument
        throw new InvalidArgumentException('The random string generator must be set to "mcrypt", "openssl" or be an instance of Kunnu\Dropbox\Security\RandomStringGeneratorInterface');
    }
public static function makeRandomStringGenerator ( $ generator = null ) { //No generator provided if ( is_null ( $ generator ) ) { //Generate default random string generator return static :: defaultRandomStringGenerator ( ) ; } //RandomStringGeneratorInterface if ( $ generator instanceof RandomStringGeneratorInterface ) { return $ generator ; } // Mcrypt if ( 'mcrypt' === $ generator ) { return new McryptRandomStringGenerator ( ) ; } //OpenSSL if ( 'openssl' === $ generator ) { return new OpenSslRandomStringGenerator ( ) ; } //Invalid Argument throw new InvalidArgumentException ( 'The random string generator must be set to "mcrypt", "openssl" or be an instance of Kunnu\Dropbox\Security\RandomStringGeneratorInterface' ) ; }
Make a Random String Generator

@param  null|string|\Kunnu\Dropbox\Security\RandomStringGeneratorInterface $generator

@throws \Kunnu\Dropbox\Exceptions\DropboxClientException

@return \Kunnu\Dropbox\Security\RandomStringGeneratorInterface
Make a Random String Generator