<commit_before><?php namespace LaravelCommode\Common\Resolver;

    use Closure;
    use Illuminate\Foundation\Application;
    use ReflectionMethod;
    use ReflectionFunction;
    use ReflectionParameter;

    /**
     * Class Resolver
     *
     * Resolver is a helper class that can resolve
     * closures and class methods or turn them into
     * resolvable closures.
     *
     * @author <NAME>
     * @package LaravelCommode\Common\Resolver
     */
    class Resolver
    {
        /**
         * Laravel application instance. Is used as an
         * access to laravel's application IoC
         *
         * @var \Illuminate\Foundation\Application
         */
        private $laraApp;

        /**
         * Class __constructor
         * @param Application $laraApp  Laravel application instance.
         * If it's value is null, it will be initialized from app() function
         */
        public function __construct(Application $laraApp = null)
        {
            /**
             * Initialize laravel IoC
             */
            $this->laraApp = !is_null($laraApp) ? $laraApp : app();
        }

        /**
         * Determines if passed ReflectionParameter $parameter can be resolved from IoC.
         * If $parameter can be resolved and it's bound in IoC it's bound class/interface name
         * will be returned.
         *
         * @param ReflectionParameter $parameter
         * @param $reflectionKey
         * @param array $params
         * @return bool|string
         */
        protected function isResolvable(ReflectionParameter $parameter, $reflectionKey, $params = array())
        {
            /**
             * check if parameter available from $params with $reflectionKey key
             */
            if (isset($params[$reflectionKey])) return false;

            /**
             * check if $parameter has type
             */
            preg_match('/\[\s\<\w+?>\s([\w\\\\]+)/s', $parameter->__toString(), $matches);

            /**
             * check if $parameter type is not array and can be treated as class/interface
             */
            $canBeCreated = isset($matches[1]) && !$parameter->isArray() && is_string($matches[1]);

            /**
             * check if $parameter class/interface exists or it's been bound
             */
            $existsOrBound = class_exists($matches[1]) || $this->laraApp->bound($matches[1]);<commit_msg>Resolver fix<commit_after><?php namespace LaravelCommode\Common\Resolver;

    use Closure;
    use Illuminate\Foundation\Application;
    use ReflectionMethod;
    use ReflectionFunction;
    use ReflectionParameter;

    /**
     * Class Resolver
     *
     * Resolver is a helper class that can resolve
     * closures and class methods or turn them into
     * resolvable closures.
     *
     * @author <NAME>
     * @package LaravelCommode\Common\Resolver
     */
    class Resolver
    {
        /**
         * Laravel application instance. Is used as an
         * access to laravel's application IoC
         *
         * @var \Illuminate\Foundation\Application
         */
        private $laraApp;

        /**
         * Class __constructor
         * @param Application $laraApp  Laravel application instance.
         * If it's value is null, it will be initialized from app() function
         */
        public function __construct(Application $laraApp = null)
        {
            /**
             * Initialize laravel IoC
             */
            $this->laraApp = !is_null($laraApp) ? $laraApp : app();
        }

        /**
         * Determines if passed ReflectionParameter $parameter can be resolved from IoC.
         * If $parameter can be resolved and it's bound in IoC it's bound class/interface name
         * will be returned.
         *
         * @param ReflectionParameter $parameter
         * @param $reflectionKey
         * @param array $params
         * @return bool|string
         */
        protected function isResolvable(ReflectionParameter $parameter, $reflectionKey, $params = array())
        {
            /**
             * check if parameter available from $params with $reflectionKey key
             */
            if (isset($params[$reflectionKey])) return false;

            /**
             * check if $parameter has type
             */
            preg_match('/\[\s\<\w+?>\s([\w\\\\]+)/s', $parameter->__toString(), $matches);

            if (count($matches) < 1) return false;

            /**
             * check if $parameter type is not array and can be treated as class/interface
             */
            $canBeCreated = isset($matches[1]) && !$parameter->isArray() && is_string($matches[1]);

            /**
             * check if $parameter class/interface exists or it's been bound
             */
            $existsOrBound = class_exists($matches[1]) || $this->laraApp->bound($matches[1]);
{'fraction_non_alphanumeric': 0.10456312666257418, 'fraction_numerical': 0.001841620626151013, 'mean_word_length': 1.804360298336202, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 17, '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': '5099883', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1233, 'n_words': 367}