public function prependScanner($name, $scanner)
    {
        $this->filterScanner($scanner);

        $scanners = [
            $name => $scanner,
        ];

        foreach ($this->getScanners() as $scannerName => $classNameOrInstance) {
            if ($scannerName !== $name) {
                $scanners[$scannerName] = $classNameOrInstance;
            }
        }

        return $this->setOption('scanners', $scanners);
    }
public function prependScanner($name, $scanner)
    {
        $this->filterScanner($scanner);

        $scanners = [
            $name => $scanner,
        ];

        foreach ($this->getScanners() as $scannerName => $classNameOrInstance) {
            if ($scannerName !== $name) {
                $scanners[$scannerName] = $classNameOrInstance;
            }
        }

        return $this->setOption('scanners', $scanners);
    }
public function prependScanner ( $ name , $ scanner ) { $ this -> filterScanner ( $ scanner ) ; $ scanners = [ $ name => $ scanner , ] ; foreach ( $ this -> getScanners ( ) as $ scannerName => $ classNameOrInstance ) { if ( $ scannerName !== $ name ) { $ scanners [ $ scannerName ] = $ classNameOrInstance ; } } return $ this -> setOption ( 'scanners' , $ scanners ) ; }
Adds a new scanner class to use in the lexing process at the top of scanning order.

The scanner class needs to extend Phug\Lexer\ScannerInterface. It can be the class name itself
or an instance of it.

@param string                  $name
@param ScannerInterface|string $scanner

@return $this
Adds a new scanner class to use in the lexing process at the top of scanning order .