<commit_before><?php
/**
 * @package Vpc
 * @subpackage Basic
 */
class Vpc_Basic_ParentContent_Component extends Vpc_Abstract
{
    public function getTemplateVars()
    {
        $ret = array();
        $data = $this->getData();
        $ids = array();
        while ($data && !$data->inherits) {
            $ids[] = strrchr($data->componentId, '-');
            $data = $data->parent;
        }
        while ($data) {
            if ($data->inherits) {
                $d = $data;
                foreach (array_reverse($ids) as $id) {
                    $d = $d->getChildComponent($id);
                }
                if (!$d) break;
                if ($d->componentClass != $this->getData()->componentClass) {
                    $ret['parentComponent'] = $d;
                }
            }
            $data = $data->parent;
        }
        return $ret;
    }

    public function hasContent()
    {
        //TODO, ist mit cache loeschen womoeglich ein problem
        return true;
    }
}<commit_msg>break sobald eine nicht ParentContent Komponente gefunden wurde, damit diese angezeigt wird<commit_after><?php
/**
 * @package Vpc
 * @subpackage Basic
 */
class Vpc_Basic_ParentContent_Component extends Vpc_Abstract
{
    public function getTemplateVars()
    {
        $ret = array();
        $data = $this->getData();
        $ids = array();
        while ($data && !$data->inherits) {
            $ids[] = strrchr($data->componentId, '-');
            $data = $data->parent;
        }
        while ($data) {
            if ($data->inherits) {
                $d = $data;
                foreach (array_reverse($ids) as $id) {
                    $d = $d->getChildComponent($id);
                }
                if (!$d) break;
                if ($d->componentClass != $this->getData()->componentClass) {
                    $ret['parentComponent'] = $d;
                    break;
                }
            }
            $data = $data->parent;
        }
        return $ret;
    }

    public function hasContent()
    {
        //TODO, ist mit cache loeschen womoeglich ein problem
        return true;
    }
}
{'fraction_non_alphanumeric': 0.13825315273236805, 'fraction_numerical': 0.0, 'mean_word_length': 1.499416569428238, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '7572600', 'n_tokens_mistral': 609, 'n_tokens_neox': 602, 'n_words': 136}