<commit_before><?php

class C33sPropelDependencyInjectorBehavior extends Behavior
{
    protected $dependencies;

    /**
     * @var int
     */
    protected $tableModificationOrder = 100;

    /**
     * Add the create_column and update_columns to the current table
     */
    public function modifyTable()
    {
        foreach ($this->getTable()->getBehaviors() as $behavior)
        {
            if (!($behavior instanceof C33sPropelDependencyCollectorBehavior))
            {
                continue;
            }

            foreach ($behavior->getModelDependenciesToInject() as $name => $data)
            {
                $this->addDependency('model', $name, $data['method'], $data['typehint']);
            }
            foreach ($behavior->getQueryDependenciesToInject() as $name => $data)
            {
                $this->addDependency('query', $name, $data['method'], $data['typehint']);
            }
        }
    }

    protected function addDependency($type, $name, $method, $typehint)
    {
        $this->dependencies[$type][$name] = array(
            'method' => $method,
            'typehint' => $typehint,
        );
    }

    protected function getDependencies($type)
    {
        return $this->dependencies[$type];
    }

    public function objectAttributes(OMBuilder $builder)
    {
        return $this->getGeneralAttributes($builder, 'model');
    }

    public function queryAttributes(OMBuilder $builder)
    {
        return $this->getGeneralAttributes($builder, 'query');
    }

    public function objectMethods(OMBuilder $builder)
    {
        return
            $this->getGeneralMethods($builder, 'model').
            $this->getDependencyMethods($builder, 'model')
        ;
    }

    public function queryMethods(OMBuilder $builder)
    {
        return
            $this->getGeneralMethods($builder, 'query').
            $this->getDependencyMethods($builder, 'query')
        ;<commit_msg>Fixed models without injected services returning null instead of array<commit_after><?php

class C33sPropelDependencyInjectorBehavior extends Behavior
{
    protected $dependencies;

    /**
     * @var int
     */
    protected $tableModificationOrder = 100;

    /**
     * Add the create_column and update_columns to the current table
     */
    public function modifyTable()
    {
        foreach ($this->getTable()->getBehaviors() as $behavior)
        {
            if (!($behavior instanceof C33sPropelDependencyCollectorBehavior))
            {
                continue;
            }

            foreach ($behavior->getModelDependenciesToInject() as $name => $data)
            {
                $this->addDependency('model', $name, $data['method'], $data['typehint']);
            }
            foreach ($behavior->getQueryDependenciesToInject() as $name => $data)
            {
                $this->addDependency('query', $name, $data['method'], $data['typehint']);
            }
        }
    }

    protected function addDependency($type, $name, $method, $typehint)
    {
        $this->dependencies[$type][$name] = array(
            'method' => $method,
            'typehint' => $typehint,
        );
    }

    protected function getDependencies($type)
    {
        return isset($this->dependencies[$type]) ? $this->dependencies[$type] : array();
    }

    public function objectAttributes(OMBuilder $builder)
    {
        return $this->getGeneralAttributes($builder, 'model');
    }

    public function queryAttributes(OMBuilder $builder)
    {
        return $this->getGeneralAttributes($builder, 'query');
    }

    public function objectMethods(OMBuilder $builder)
    {
        return
            $this->getGeneralMethods($builder, 'model').
            $this->getDependencyMethods($builder, 'model')
        ;
    }

    public function queryMethods(OMBuilder $builder)
    {
        return
            $this->getGeneralMethods($builder, 'query').
            $this->getDependencyMethods($builder, 'query')
        ;
{'fraction_non_alphanumeric': 0.12722263961933383, 'fraction_numerical': 0.003506135737540696, 'mean_word_length': 2.255093724531377, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '7310907', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1015, 'n_words': 211}