Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
75.00% covered (warning)
75.00%
3 / 4
CRAP
87.50% covered (warning)
87.50%
7 / 8
WordsQueryNode
0.00% covered (danger)
0.00%
0 / 1
75.00% covered (warning)
75.00%
3 / 4
4.03
87.50% covered (warning)
87.50%
7 / 8
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 toArray
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getWords
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 accept
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
<?php
namespace CirrusSearch\Parser\AST;
use CirrusSearch\Parser\AST\Visitor\Visitor;
/**
 * Simple query node made of words.
 */
class WordsQueryNode extends ParsedNode {
    /**
     * @var string
     */
    private $words;
    /**
     * @param int $startOffset
     * @param int $endOffset
     * @param string $words
     */
    public function __construct( $startOffset, $endOffset, $words ) {
        parent::__construct( $startOffset, $endOffset );
        $this->words = $words;
    }
    /**
     * @return array
     */
    public function toArray() {
        return [
            'words' => array_merge( parent::baseParams(), [
                'words' => $this->words
            ] )
        ];
    }
    /**
     * @return string
     */
    public function getWords() {
        return $this->words;
    }
    /**
     * @param Visitor $visitor
     */
    public function accept( Visitor $visitor ) {
        $visitor->visitWordsQueryNode( $this );
    }
}