<commit_before><?php namespace Bbatsche\Entrust;

/**
 * This class is the main entry point of entrust. Usually this the interaction
 * with this class will be done through the Entrust Facade
 *
 * @license MIT
 * @package Bbatsche\Entrust
 */
class Entrust
{
    /**
     * Laravel application
     *
     * @var \Illuminate\Foundation\Application
     */
    public $app;

    /**
     * Create a new Entrust instance.
     *
     * @param \Illuminate\Foundation\Application $app
     *
     * @return void
     */
    public function __construct($app)
    {
        $this->app = $app;
    }

    /**
     * Checks if the current user has one or more roles by their name
     *
     * @param string|array $name       Role name or array of role names.
     * @param bool         $requireAll All roles in the array are required.
     *
     * @deprecated
     * @see \Bbatsche\Entrust\Entrust\is
     * @see \Bbatsche\Entrust\Entrust\isAny
     * @see \Bbatsche\Entrust\Entrust\isAll
     *
     * @return bool
     */
    public function hasRole($role, $requireAll = false)
    {
        if ($user = $this->user()) {
            return $user->hasRole($role, $requireAll);
        }

        return false;
    }

    /**
     * Check if current user has a role by its name
     *
     * @param string $role Role name.
     *
     * @return bool
     */
    public function is($role)
    {
        if ($user = $this->user()) {
            return $user->is($role);
        }

        return false;
    }

    /**
     * Check if current user has <b>any</b> named roles.
     *
     * @param array  $roles       Array of role names.
     * @param array &$failedRoles The names of what roles were missing (if any).
     *
     * @return bool
     */
    public function isAny(array $roles, array &$failedRoles = array())
    {
        if ($user = $this->user()) {
            return $user->isAny($roles, $failedRoles);
        }

        return false;
    }

    /**
     * Check if the current user has <b>all</b> named roles.
     *
     * @param array  $roles       Array of role names.
     * @param array &$failedRoles The names of what roles were missing (if any).
     *
     * @return bool
     */
    public function isAll(array $roles, array &$failedRoles = array())
    {
        if ($user = $this->user()) {
            return $user->isAll($roles, $failedRoles);
        }

        return false;
    }

    /**
     * Check if the current user has a permission by its name.
     * Using this function with an array of roles is considered @deprecated.
     *
     * @param string|array $permission Permission name or array of permission names.
     * @param bool         $requireAll All permissions in the array are required, @deprecated.
     *
     * @return bool
     */
    public function can($permission, $requireAll = false)
    {
        if ($user = $this->user()) {
            return $user->can($permission, $requireAll);
        }

        return false;
    }

    /**
     * Check if the current user has <b>any</b> named permissions.
     *
     * @param array  $perms       Array of permission names.
     * @param array &$failedPerms The names of what permissions were missing (if any).
     *
     * @return bool
     */
    public function canAny(array $perms, array &$failedPerms = array())
    {
        if ($user = $this->user()) {
            return $user->canAny($perms, $failedPerms);
        }

        return false;
    }

    /**
     * Check if the current user has <b>all</b> named permissions.
     *
     * @param array  $perms       Array of permission names.
     * @param array &$failedPerms The names of what permissions were missing (if any).
     *
     * @return bool
     */
    public function canAll(array $perms, array &$failedPerms = array())
    {
        if ($user = $this->user()) {
            return $user->canAll($perms, $failedPerms);
        }

        return false;
    }
<commit_msg>Fix documentation errors in Entrust class Remove array type hinting (in case user wants to send collection or something similar)<commit_after><?php namespace Bbatsche\Entrust;

/**
 * This class is the main entry point of entrust. Usually this the interaction
 * with this class will be done through the Entrust Facade
 *
 * @license MIT
 * @package Bbatsche\Entrust
 */
class Entrust
{
    /**
     * Laravel application
     *
     * @var \Illuminate\Foundation\Application
     */
    public $app;

    /**
     * Create a new Entrust instance.
     *
     * @param \Illuminate\Foundation\Application $app
     *
     * @return void
     */
    public function __construct($app)
    {
        $this->app = $app;
    }

    /**
     * Checks if the current user has one or more roles by their name
     *
     * @param string|array $name       Role name or array of role names.
     * @param bool         $requireAll All roles in the array are required.
     *
     * @deprecated
     * @see \Bbatsche\Entrust\Entrust::is()
     * @see \Bbatsche\Entrust\Entrust::isAny()
     * @see \Bbatsche\Entrust\Entrust::isAll()
     *
     * @return bool
     */
    public function hasRole($role, $requireAll = false)
    {
        if ($user = $this->user()) {
            return $user->hasRole($role, $requireAll);
        }

        return false;
    }

    /**
     * Check if current user has a role by its name
     *
     * @param string $role Role name.
     *
     * @return bool
     */
    public function is($role)
    {
        if ($user = $this->user()) {
            return $user->is($role);
        }

        return false;
    }

    /**
     * Check if current user has <b>any</b> named roles.
     *
     * @param mixed  $roles       Set of role names.
     * @param array &$failedRoles The names of what roles were missing (if any).
     *
     * @return bool
     */
    public function isAny($roles, array &$failedRoles = array())
    {
        if ($user = $this->user()) {
            return $user->isAny($roles, $failedRoles);
        }

        return false;
    }

    /**
     * Check if the current user has <b>all</b> named roles.
     *
     * @param mixed  $roles       Set of role names.
     * @param array &$failedRoles The names of what roles were missing (if any).
     *
     * @return bool
     */
    public function isAll($roles, array &$failedRoles = array())
    {
        if ($user = $this->user()) {
            return $user->isAll($roles, $failedRoles);
        }

        return false;
    }

    /**
     * Check if the current user has a permission by its name.
     * Using this function with an array of roles is considered @deprecated.
     *
     * @param string|array $permission Permission name or array of permission names.
     * @param bool         $requireAll All permissions in the array are required, @deprecated.
     *
     * @see \Bbatsche\Entrust\Entrust::canAny()
     * @see \Bbatsche\Entrust\Entrust::canAll()
     *
     * @return bool
     */
    public function can($permission, $requireAll = false)
    {
        if ($user = $this->user()) {
            return $user->can($permission, $requireAll);
        }

        return false;
    }

    /**
     * Check if the current user has <b>any</b> named permissions.
     *
     * @param mixed  $perms       Set of permission names.
     * @param array &$failedPerms The names of what permissions were missing (if any).
     *
     * @return bool
     */
    public function canAny($perms, array &$failedPerms = array())
    {
        if ($user = $this->user()) {
            return $user->canAny($perms, $failedPerms);
        }

        return false;
    }

    /**
     * Check if the current user has <b>all</b> named permissions.
     *
     * @param mixed  $perms       Set of permission names.
     * @param array &$failedPerms The names of what permissions were missing (if any).
     *
     * @return bool
     */
    public function canAll($perms, array &$failedPerms = array())
    {
        if ($user = $this->user()) {
            return $user->canAll($perms, $failedPerms);
        }

        return false;
    }

{'fraction_non_alphanumeric': 0.11783636588686719, 'fraction_numerical': 0.0, 'mean_word_length': 1.915914832190545, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 49, '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': '4857504', 'n_tokens_mistral': 2425, 'n_tokens_neox': 2352, 'n_words': 763}