<commit_before><?php

namespace Silber\Bouncer\Conductors;

trait ConductsAbilities
{
    /**
     * Allow/disallow all abilities on everything.
     *
     * @return mixed
     */
    public function everything()
    {
        return $this->to('*', '*');
    }

    /**
     * Allow/disallow all abilities on the given model.
     *
     * @param  string|\Illuminate\Database\Eloquent\Model  $model
     * @return mixed
     */
    public function toManage($model)
    {
        return $this->to('*', $model);
    }

    /**
     * Allow/disallow the given ability on all models.
     *
     * @param  string  $ability
     * @return mixed
     */
    public function toAlways($ability)
    {
        return $this->to($ability, '*');
    }

    /**
     * Allow/disallow owning the given model.
     *
     * @param  string  $model
     * @param  string|array  $abilities
     * @return void
     */
    public function toOwn($model, $abilities = '*')
    {
        if (is_string($abilities)) {
            $this->to($abilities, $model, true);
        } else {
            foreach ($abilities as $ability) {
                $this->to($ability, $model, true);
            }
        }
    }
<commit_msg>Allow passing multiple models/abilities at once<commit_after><?php

namespace Silber\Bouncer\Conductors;

trait ConductsAbilities
{
    /**
     * Allow/disallow all abilities on everything.
     *
     * @return mixed
     */
    public function everything()
    {
        return $this->to('*', '*');
    }

    /**
     * Allow/disallow all abilities on the given model.
     *
     * @param  string|array|\Illuminate\Database\Eloquent\Model  $models
     * @return void
     */
    public function toManage($models)
    {
        if (is_array($models)) {
            foreach ($models as $model) {
                $this->to('*', $model);
            }
        } else {
            $this->to('*', $models);
        }
    }

    /**
     * Allow/disallow the given ability on all models.
     *
     * @param  array|string  $abilities
     * @return mixed
     */
    public function toAlways($abilities)
    {
        if (is_array($abilities)) {
            foreach ($abilities as $ability) {
                $this->to($ability, '*');
            }
        } else {
            $this->to($abilities, '*');
        }
    }

    /**
     * Allow/disallow owning the given model.
     *
     * @param  string  $model
     * @param  string|array  $abilities
     * @return void
     */
    public function toOwn($model, $abilities = '*')
    {
        if (is_string($abilities)) {
            $this->to($abilities, $model, true);
        } else {
            foreach ($abilities as $ability) {
                $this->to($ability, $model, true);
            }
        }
    }

{'fraction_non_alphanumeric': 0.1395097332372026, 'fraction_numerical': 0.0, 'mean_word_length': 1.6915615906886519, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '1992887', 'n_tokens_mistral': 836, 'n_tokens_neox': 820, 'n_words': 184}