<commit_before><?php
declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Hydrator;

use stdClass;
use WoohooLabs\Yang\JsonApi\Schema\Document;
use WoohooLabs\Yang\JsonApi\Schema\Relationship;
use WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObject;

class ClassDocumentHydrator extends AbstractClassDocumentHydrator
{
    /**
     * @return stdClass[]
     */
    public function hydrate(Document $document): iterable
    {
        return parent::hydrate($document);
    }

    /**
     * @return stdClass[]
     */
    public function hydrateCollection(Document $document): iterable
    {
        return parent::hydrateCollection($document);
    }

    public function hydrateSingleResource(Document $document): stdClass
    {
        return parent::hydrateSingleResource($document);
    }

    protected function createObject(ResourceObject $resource): object
    {
        return new stdClass();<commit_msg>Allow to return other objects than 'stdClass'<commit_after><?php
declare(strict_types=1);

namespace WoohooLabs\Yang\JsonApi\Hydrator;

use stdClass;
use WoohooLabs\Yang\JsonApi\Schema\Document;
use WoohooLabs\Yang\JsonApi\Schema\Relationship;
use WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObject;

class ClassDocumentHydrator extends AbstractClassDocumentHydrator
{
    /**
     * @return stdClass[]
     */
    public function hydrate(Document $document): iterable
    {
        return parent::hydrate($document);
    }

    /**
     * @return stdClass[]
     */
    public function hydrateCollection(Document $document): iterable
    {
        return parent::hydrateCollection($document);
    }

    public function hydrateSingleResource(Document $document): object
    {
        return parent::hydrateSingleResource($document);
    }

    protected function createObject(ResourceObject $resource): object
    {
        return new stdClass();
{'fraction_non_alphanumeric': 0.10042735042735043, 'fraction_numerical': 0.0010683760683760685, 'mean_word_length': 3.790281329923274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6337123', 'n_tokens_mistral': 553, 'n_tokens_neox': 526, 'n_words': 103}