<commit_before><?php

namespace DanielBadura\Redmine\Api\Hydration;

use DanielBadura\Redmine\Api\Client;
use DanielBadura\Redmine\Api\Struct\Issue;
use DanielBadura\Redmine\Api\Struct\Project;
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
use ProxyManager\Proxy\LazyLoadingInterface;

/**
 * @author <NAME> <<EMAIL>>
 */
class IssueProjectHydration
{
    /**
     * @param Issue $issue
     * @param Client $client
     * @return Issue
     */
    public function hydrateOneIssue(Issue $issue, Client $client)
    {
        $project = $issue->getProject();
        $pR = $client->getProjectRepository();

        $factory = new LazyLoadingValueHolderFactory();
        $initializer = function (
            &$wrappedObject,
            LazyLoadingInterface $proxy,
            $method
        ) use ($project, $pR, $issue) {
            $wrappedObject = $issue;
            if('getProject' == $method) {
                $wrappedObject = $issue;
                $wrappedObject->setProject($pR->find($project->id));<commit_msg>removed unnecessary allocation of wrapperObject<commit_after><?php

namespace DanielBadura\Redmine\Api\Hydration;

use DanielBadura\Redmine\Api\Client;
use DanielBadura\Redmine\Api\Struct\Issue;
use DanielBadura\Redmine\Api\Struct\Project;
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
use ProxyManager\Proxy\LazyLoadingInterface;

/**
 * @author <NAME> <<EMAIL>>
 */
class IssueProjectHydration
{
    /**
     * @param Issue $issue
     * @param Client $client
     * @return Issue
     */
    public function hydrateOneIssue(Issue $issue, Client $client)
    {
        $project = $issue->getProject();
        $pR = $client->getProjectRepository();

        $factory = new LazyLoadingValueHolderFactory();
        $initializer = function (
            &$wrappedObject,
            LazyLoadingInterface $proxy,
            $method
        ) use ($project, $pR, $issue) {
            $wrappedObject = $issue;
            if('getProject' == $method) {
                $wrappedObject->setProject($pR->find($project->id));
{'fraction_non_alphanumeric': 0.12493946731234867, 'fraction_numerical': 0.0, 'mean_word_length': 2.8834586466165413, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '962085', 'n_tokens_mistral': 613, 'n_tokens_neox': 600, 'n_words': 113}