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
PhrasePrefixNode
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
 getPhrase
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;
/**
 * A phrase prefix.
 */
class PhrasePrefixNode extends ParsedNode {
    /**
     * @var string
     */
    private $phrase;
    /**
     * @param int $startOffset
     * @param int $endOffset
     * @param string $phrase
     */
    public function __construct( $startOffset, $endOffset, $phrase ) {
        parent::__construct( $startOffset, $endOffset );
        $this->phrase = $phrase;
    }
    /**
     * @return array
     */
    public function toArray() {
        return [
            "phrase_prefix" => array_merge( parent::baseParams(), [
                'phrase' => $this->phrase
            ] )
        ];
    }
    /**
     * @return string
     */
    public function getPhrase() {
        return $this->phrase;
    }
    /**
     * @param Visitor $visitor
     */
    public function accept( Visitor $visitor ) {
        $visitor->visitPhrasePrefixNode( $this );
    }
}