<commit_before><?php

namespace Illuminate\Database\Eloquent\Relations;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;

class MorphTo extends BelongsTo
{
    /**
     * The type of the polymorphic relation.
     *
     * @var string
     */
    protected $morphType;

    /**
     * A map between the morphable type saved to database and the actual class.
     *
     * @var array
     */
    protected $morphMap = [];

    /**
     * The models whose relations are being eager loaded.
     *
     * @var \Illuminate\Database\Eloquent\Collection
     */
    protected $models;

    /**
     * All of the models keyed by ID.
     *
     * @var array
     */
    protected $dictionary = [];

    /*
     * Indicates if soft-deleted model instances should be fetched.
     *
     * @var bool
     */
    protected $withTrashed = false;

    /**
     * Create a new morph to relationship instance.
     *
     * @param  \Illuminate\Database\Eloquent\Builder $query
     * @param  \Illuminate\Database\Eloquent\Model $parent
     * @param  string $foreignKey
     * @param  string $otherKey
     * @param  string $type
     * @param  string $relation
     * @param  array $morphMap
     */
    public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $type, $relation, array $morphMap)
    {
        $this->morphType = $type;

        $this->morphMap = $morphMap;

        parent::__construct($query, $parent, $foreignKey, $otherKey, $relation);
    }

    /**
     * Get the results of the relationship.
     *
     * @return mixed
     */
    public function getResults()
    {
        if (!$this->otherKey) {
            return;
        }
<commit_msg>added a default value so that we don't have to update instantiation of the class elsewhere, for sake of compatibility with all other uses<commit_after><?php

namespace Illuminate\Database\Eloquent\Relations;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;

class MorphTo extends BelongsTo
{
    /**
     * The type of the polymorphic relation.
     *
     * @var string
     */
    protected $morphType;

    /**
     * A map between the morphable type saved to database and the actual class.
     *
     * @var array
     */
    protected $morphMap = [];

    /**
     * The models whose relations are being eager loaded.
     *
     * @var \Illuminate\Database\Eloquent\Collection
     */
    protected $models;

    /**
     * All of the models keyed by ID.
     *
     * @var array
     */
    protected $dictionary = [];

    /*
     * Indicates if soft-deleted model instances should be fetched.
     *
     * @var bool
     */
    protected $withTrashed = false;

    /**
     * Create a new morph to relationship instance.
     *
     * @param  \Illuminate\Database\Eloquent\Builder $query
     * @param  \Illuminate\Database\Eloquent\Model $parent
     * @param  string $foreignKey
     * @param  string $otherKey
     * @param  string $type
     * @param  string $relation
     * @param  array $morphMap
     */
    public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $type, $relation, array $morphMap = [])
    {
        $this->morphType = $type;

        $this->morphMap = $morphMap;

        parent::__construct($query, $parent, $foreignKey, $otherKey, $relation);
    }

    /**
     * Get the results of the relationship.
     *
     * @return mixed
     */
    public function getResults()
    {
        if (!$this->otherKey) {
            return;
        }

{'fraction_non_alphanumeric': 0.10848667948365834, 'fraction_numerical': 0.0, 'mean_word_length': 2.2344582593250446, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3014974', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1096, 'n_words': 301}