<commit_before><?php

declare(strict_types=1);

namespace Ray\Di;

use ReflectionMethod;
use ReflectionParameter;

final class UntargetedBind
{
    public function __invoke(Container $container, ReflectionMethod $method) : void
    {
        $parameters = $method->getParameters();
        foreach ($parameters as $parameter) {
            $this->addConcreteClass($container, $parameter);
        }
    }

    private function addConcreteClass(Container $container, ReflectionParameter $parameter) : void
    {
        $class = $this->getTypeHint($parameter);
        if (class_exists($class)) {
            new Bind($container, $class);
        }
    }

    private function getTypeHint(ReflectionParameter $parameter) : string
    {
        $typeHintClass = $parameter->getType();

        return $typeHintClass ? $typeHintClass->name : '';
    }
}
<commit_msg>Fix php8 deprecated method<commit_after><?php

declare(strict_types=1);

namespace Ray\Di;

use ReflectionMethod;
use ReflectionParameter;

final class UntargetedBind
{
    public function __invoke(Container $container, ReflectionMethod $method) : void
    {
        $parameters = $method->getParameters();
        foreach ($parameters as $parameter) {
            $this->addConcreteClass($container, $parameter);
        }
    }

    private function addConcreteClass(Container $container, ReflectionParameter $parameter) : void
    {
        $class = $this->getTypeHint($parameter);
        if (class_exists($class)) {
            new Bind($container, $class);
        }
    }

    private function getTypeHint(ReflectionParameter $parameter) : string
    {
        $typeHintClass = $parameter->getType();

        return $typeHintClass ? $typeHintClass->getName() : '';
    }
}

{'fraction_non_alphanumeric': 0.11467889908256881, 'fraction_numerical': 0.0017201834862385322, 'mean_word_length': 3.1547619047619047, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '3276485', 'n_tokens_mistral': 478, 'n_tokens_neox': 469, 'n_words': 103}