src/StringUtils.php
public static function alternator(array $strings)
    {
        return function() use ($strings) {
            static $i = 0;
            $index = $i++ % count($strings);

            return $strings[$index];
        };
    }
public static function alternator(array $strings)
    {
        return function() use ($strings) {
            static $i = 0;
            $index = $i++ % count($strings);

            return $strings[$index];
        };
    }
public static function alternator ( array $ strings ) { return function ( ) use ( $ strings ) { static $ i = 0 ; $ index = $ i ++ % count ( $ strings ) ; return $ strings [ $ index ] ; } ; }
Returns a closure that will alternate between the defined strings.

@param array $strings Array of strings to alternate between.

@return Closure
Returns a closure that will alternate between the defined strings .