Queue.php
public function dequeue($platform = null)
    {
        if (null === $platform) {
            return array_shift($this->queue);
        }

        // The array pointer does not reset between method calls. So we need to reset it manually.
        reset($this->queue);

        do {
            $index = key($this->queue);
            $method = current($this->queue);
            next($this->queue);
        } while ($method instanceof MethodInterface && !$method->supports($platform));

        if (null !== $index) {
            unset($this->queue[$index]);
        }
        if (false === $method) {
            $method = null;
        }

        return $method;
    }
public function dequeue($platform = null)
    {
        if (null === $platform) {
            return array_shift($this->queue);
        }

        // The array pointer does not reset between method calls. So we need to reset it manually.
        reset($this->queue);

        do {
            $index = key($this->queue);
            $method = current($this->queue);
            next($this->queue);
        } while ($method instanceof MethodInterface && !$method->supports($platform));

        if (null !== $index) {
            unset($this->queue[$index]);
        }
        if (false === $method) {
            $method = null;
        }

        return $method;
    }
public function dequeue ( $ platform = null ) { if ( null === $ platform ) { return array_shift ( $ this -> queue ) ; } // The array pointer does not reset between method calls. So we need to reset it manually. reset ( $ this -> queue ) ; do { $ index = key ( $ this -> queue ) ; $ method = current ( $ this -> queue ) ; next ( $ this -> queue ) ; } while ( $ method instanceof MethodInterface && ! $ method -> supports ( $ platform ) ) ; if ( null !== $ index ) { unset ( $ this -> queue [ $ index ] ) ; } if ( false === $ method ) { $ method = null ; } return $ method ; }
Removes the method at the beginning of the queue. You can optionally
filter to dequeue a specific platform method.

@param string $platform

@return MethodInterface|null
Removes the method at the beginning of the queue . You can optionally filter to dequeue a specific platform method .