Skip to content
ExpressionNotSupportedByQuestion.php 1022 B
Newer Older
<?php

/**
 * Class ExpressionNotSupportedByQuestion
Michael Jansen's avatar
Michael Jansen committed
 * @package
 *
 * Date: 25.03.13
 * Time: 15:15
 * @author Thomas Joußen <tjoussen@databay.de>
Michael Jansen's avatar
Michael Jansen committed
 */
class ExpressionNotSupportedByQuestion extends \RuntimeException
{
Michael Jansen's avatar
Michael Jansen committed
    /**
     * @var string
     */
    protected $expression;
Michael Jansen's avatar
Michael Jansen committed
    /**
     * @var int
     */
    protected $question_index;
Michael Jansen's avatar
Michael Jansen committed
    /**
     * @param string $expression
     * @param int    $question_index
     */
    public function __construct($expression, $question_index)
    {
        $this->expression = $expression;
        $this->question_index = $question_index;
Michael Jansen's avatar
Michael Jansen committed
        parent::__construct(
            sprintf('The expression "%s" is not supported by the question with index "Q%s"', $this->expression, $this->question_index)
        );
    }
Michael Jansen's avatar
Michael Jansen committed
    /**
     * @return int
     */
    public function getQuestionIndex()
    {
        return $this->question_index;
    }
Michael Jansen's avatar
Michael Jansen committed
    /**
     * @return string
     */
    public function getExpression()
    {
        return $this->expression;
    }
}