<commit_before><?php
namespace Poirot\PathUri\Query;

use Poirot\Core\Entity;
use Poirot\Core\Interfaces\iPoirotEntity;
use Poirot\PathUri\Interfaces\iPQueryEntity;

class PQEntity extends Entity
    implements iPQueryEntity
{
    /**
     * @override
     *
     * @param string|array|iPoirotEntity $resource
     *
     * @return iPoirotEntity
     */
    function __setFrom($resource)
    {
        $this->__validateProps($resource);

        if (is_string($resource))
            parse_str($resource, $resource);

        return $resource;
    }<commit_msg>fix to set properties from pathUri object resource.<commit_after><?php
namespace Poirot\PathUri\Query;

use Poirot\Core\Entity;
use Poirot\Core\Interfaces\EntityInterface;
use Poirot\Core\Interfaces\iPoirotEntity;
use Poirot\PathUri\Interfaces\iPQueryEntity;

class PQEntity extends Entity
    implements iPQueryEntity
{
    /**
     * @override
     *
     * Set Properties
     *
     * - You can implement this method on subclasses
     *
     * @param EntityInterface $resource
     *
     * @throws \InvalidArgumentException
     * @return array
     */
    function __setFrom($resource)
    {
        $resource = parent::__setFrom($resource);

        if (is_string($resource))
            parse_str($resource, $resource);

        return $resource;
    }
{'fraction_non_alphanumeric': 0.10136157337367625, 'fraction_numerical': 0.0, 'mean_word_length': 2.857142857142857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '2050573', 'n_tokens_mistral': 406, 'n_tokens_neox': 403, 'n_words': 81}