src/Adapter/AdapterChain.php
public function prependAdapter(AdapterInterface $adapter)
    {
        $priority = self::DEFAULT_PRIORITY;

        if (!$this->adapters->isEmpty()) {
            $extractedNodes = $this->adapters->toArray(PriorityQueue::EXTR_PRIORITY);

            rsort($extractedNodes, SORT_NUMERIC);

            $priority = $extractedNodes[0] + 1;
        }

        $this->adapters->insert($adapter, $priority);

        return $this;
    }
public function prependAdapter(AdapterInterface $adapter)
    {
        $priority = self::DEFAULT_PRIORITY;

        if (!$this->adapters->isEmpty()) {
            $extractedNodes = $this->adapters->toArray(PriorityQueue::EXTR_PRIORITY);

            rsort($extractedNodes, SORT_NUMERIC);

            $priority = $extractedNodes[0] + 1;
        }

        $this->adapters->insert($adapter, $priority);

        return $this;
    }
public function prependAdapter ( AdapterInterface $ adapter ) { $ priority = self :: DEFAULT_PRIORITY ; if ( ! $ this -> adapters -> isEmpty ( ) ) { $ extractedNodes = $ this -> adapters -> toArray ( PriorityQueue :: EXTR_PRIORITY ) ; rsort ( $ extractedNodes , SORT_NUMERIC ) ; $ priority = $ extractedNodes [ 0 ] + 1 ; } $ this -> adapters -> insert ( $ adapter , $ priority ) ; return $ this ; }
Adds a adapter to the beginning of the chain.

@param AdapterInterface $adapter

@return $this
Adds a adapter to the beginning of the chain .