<commit_before><?php

class CM_Frontend_TreeNode implements Tree\Node\NodeInterface {

    use \Tree\Node\NodeTrait;

    /** @var CM_ViewResponse */
    private $_viewResponse;

    /**
     * @param CM_ViewResponse $viewResponse
     */
    public function __construct(CM_ViewResponse $viewResponse) {
        $this->_setViewResponse($viewResponse);
    }

    /**
     * @return CM_ViewResponse
     */
    public function getValue() {
        return $this->_viewResponse;
    }

    /**
     * @param CM_ViewResponse $value
     * @return \Tree\Node\NodeInterface
     */
    public function setValue($value) {
        $this->_setViewResponse($value);
        return $this;
    }

    /**
     * @return self
     */
    public function getParent() {
        return $this->parent;
    }

    /**
     * @param string $className
     * @return self|null
     */
    public function getClosest($className) {
        if ($this->_viewResponse->getView() instanceof $className) {
            return $this;
        }
        if (!$this->isRoot()) {
            return $this->getParent()->getClosest($className);
        }
        return null;
    }

    /**
     * @param CM_ViewResponse $viewResponse
     */
    private function _setViewResponse(CM_ViewResponse $viewResponse) {
        $this->_viewResponse = $viewResponse;
    }
}<commit_msg>Remove getClosest on Frontend_TreeNode, replace usages with Fronted->getClosestViewResponse()<commit_after><?php

class CM_Frontend_TreeNode implements Tree\Node\NodeInterface {

    use \Tree\Node\NodeTrait;

    /** @var CM_ViewResponse */
    private $_viewResponse;

    /**
     * @param CM_ViewResponse $viewResponse
     */
    public function __construct(CM_ViewResponse $viewResponse) {
        $this->_setViewResponse($viewResponse);
    }

    /**
     * @return CM_ViewResponse
     */
    public function getValue() {
        return $this->_viewResponse;
    }

    /**
     * @param CM_ViewResponse $value
     * @return \Tree\Node\NodeInterface
     */
    public function setValue($value) {
        $this->_setViewResponse($value);
        return $this;
    }

    /**
     * @return self
     */
    public function getParent() {
        return $this->parent;
    }

    /**
     * @param CM_ViewResponse $viewResponse
     */
    private function _setViewResponse(CM_ViewResponse $viewResponse) {
        $this->_viewResponse = $viewResponse;
    }
}
{'fraction_non_alphanumeric': 0.12064676616915423, 'fraction_numerical': 0.0, 'mean_word_length': 2.3513888888888888, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3723839', 'n_tokens_mistral': 704, 'n_tokens_neox': 690, 'n_words': 133}