Hydrate a census object into a CensusEntity object

@param \stdClass $census
@return CensusEntity
199872
public static function hydrate(stdClass $census)
    {
        $hydrated = new CensusEntity();

        if (isset($census->id)) {
            $hydrated->setId($census->id);
        }

        if (isset($census->scans)) {
            $hydrated->setScans($census->scans);
        }

        if (isset($census->issues)) {
            $hydrated->setIssues($census->issues);
        }

        if (isset($census->loc)) {
            $hydrated->setLoc($census->loc);
        }

        return $hydrated;
    }
1168523
public static function hydrate(stdClass $ignore)
    {
        $hydrated = new IgnoredCodeEntity();

        if (isset($ignore->id)) {
            $hydrated->setId($ignore->id);
        }

        if (isset($ignore->class)) {
            $hydrated->setClass($ignore->class);
        }

        if (isset($ignore->method)) {
            $hydrated->setMethod($ignore->method);
        }

        if (isset($ignore->exclude)) {
            $hydrated->setExclude($ignore->exclude);
        }

        return $hydrated;
    }
1073646
protected function fill($document, \stdClass $object)
    {
        $metadata = $this->getMetadataFactory()->getMetadataFor(get_class($document));
        $propertyAnnotations = $this->getMetadataFactory()->getObjectPropertyAnnotations($document);

        foreach ($propertyAnnotations as $property => $annotation) {
            $documentProperty = $property;

            if ($annotation->name) {
                $property = $annotation->name;
            }

            if (property_exists($object, $property)) {
                $value = $this->hydrateValue($object->$property, $annotation);
                $metadata->setDocumentValue($document, $documentProperty, $value);
            }
        }

        if ($document instanceof Proxy) {
            $document->__setInitialized(true);
        }

        return $document;
    }
387149
protected function populate(stdClass $response)
    {
        $entry = clone $this;

        $entry->data->id = $this->getIfSet('id', $response);
        $entry->data->status = $this->getIfSet('status', $response);
        $entry->data->operation = $this->getIfSet('operation', $response);

        if (isset($response->amount)) {
            $entry->data->amount->total = $this->getIfSet('total', $response->amount);
            $entry->data->amount->fee = $this->getIfSet('fee', $response->amount);
            $entry->data->amount->liquid = $this->getIfSet('liquid', $response->amount);
            $entry->data->amount->currency = $this->getIfSet('currency', $response->amount);
        }

        if (isset($response->details)) {
            $entry->data->details = $this->getIfSet('details', $response);
        }

        if (isset($response->{'parent'}) && isset($response->{'parent'}->payments)) {
            $payments = new Payment($entry->moip);
            $payments->populate($response->{'parent'}->payments);

            $entry->data->parentPayments = $payments;
        }

        return $entry;
    }
1070749
public static function hydrate(stdClass $ignore)
    {
        $hydrated = new IgnoredLocationEntity();

        if (isset($ignore->id)) {
            $hydrated->setId($ignore->id);
        }

        if (isset($ignore->path)) {
            $hydrated->setPath($ignore->path);
        }

        if (isset($ignore->match)) {
            $hydrated->setMatch($ignore->match);
        }

        if (isset($ignore->exclude)) {
            $hydrated->setExclude($ignore->exclude);
        }

        return $hydrated;
    }
1146387
public static function hydrate(stdClass $language)
    {
        $hydrated = new LanguageEntity();

        if (isset($language->id)) {
            $hydrated->setId($language->id);
        }

        if (isset($language->name)) {
            $hydrated->setName($language->name);
        }

        if (isset($language->file_extensions)) {
            $hydrated->setFileExtensions($language->file_extensions);
        }

        if (isset($language->config_file_extensions)) {
            $hydrated->setConfigFileExtensions($language->config_file_extensions);
        }

        return $hydrated;
    }
340412
public static function hydrate(stdClass $activity)
    {
        $hydrated = new ActivityEntity();

        if (isset($activity->id)) {
            $hydrated->setId($activity->id);
        }

        if (isset($activity->type)) {
            $hydrated->setType($activity->type);
        }

        if (isset($activity->context)) {
            $hydrated->setContext(json_decode(json_encode($activity->context), true));
        }

        if (isset($activity->application)) {
            $hydrated->setApplication(ApplicationHydrator::hydrate($activity->application));
        }

        if (isset($activity->created_by)) {
            $hydrated->setCreatedBy(UserHydrator::hydrate($activity->created_by));
        }

        if (isset($activity->created_at)) {
            $hydrated->setCreatedAt(new DateTime($activity->created_at));
        }

        return $hydrated;
    }
1216649
public static function hydrate(stdClass $concat)
    {
        $hydrated = new ConcatEntity();

        if (isset($concat->id)) {
            $hydrated->setId($concat->id);
        }

        if (isset($concat->line)) {
            $hydrated->setLine($concat->line);
        }

        if (isset($concat->start_line)) {
            $hydrated->setStartLine($concat->start_line);
        }

        if (isset($concat->end_line)) {
            $hydrated->setEndLine($concat->end_line);
        }

        if (isset($concat->file)) {
            $hydrated->setFile(FileHydrator::hydrate($concat->file));
        }

        if (isset($concat->function)) {
            $hydrated->setFunction(CustomFunctionHydrator::hydrate($concat->function));
        }

        if (isset($concat->class)) {
            $hydrated->setClass(CustomClassHydrator::hydrate($concat->class));
        }

        if (isset($concat->start_column)) {
            $hydrated->setStartColumn($concat->start_column);
        }

        if (isset($concat->end_column)) {
            $hydrated->setEndColumn($concat->end_column);
        }

        if (isset($concat->taint)) {
            $hydrated->setTaint(TaintHydrator::hydrate($concat->taint));
        }

        return $hydrated;
    }
498939
public static function arrayToObject(array $source): \stdClass
    {
        $result = new stdClass();

        $json = json_encode($source);
        if ($json === false) {
            return $result;
        }

        $object = json_decode($json);
        if ($object === null) {
            return $result;
        }
        $result = $object;

        return $result;
    }
1310456
public static function hydrate(stdClass $review)
    {
        $hydrated = new ReviewEntity();

        if (isset($review->id)) {
            $hydrated->setId($review->id);
        }

        if (isset($review->created_at)) {
            $hydrated->setCreatedAt(new DateTime($review->created_at));
        }

        if (isset($review->type)) {
            $hydrated->setType(ReviewTypeHydrator::hydrate($review->type));
        }

        if (isset($review->created_by)) {
            $hydrated->setCreatedBy(UserHydrator::hydrate($review->created_by));
        }

        if (isset($review->source)) {
            $hydrated->setSource($review->source);
        }

        if (isset($review->issue)) {
            $hydrated->setIssue(IssueHydrator::hydrate($review->issue));
        }

        return $hydrated;
    }
1011286
public function hydrate(array $data, $object)
    {
        if (! $object instanceof Entity) {
            return $object;
        }
                
        parent::hydrate($data, $object);
               
        $authEntity = parent::hydrate($data, new \Pacificnm\Auth\Entity\Entity());
        
        $object->setAuthEntity($authEntity);
        
        $aclRoleEntity = parent::hydrate($data, new \Pacificnm\AclRole\Entity\Entity());
        
        $object->getAuthEntity()->setAclRoleEntity($aclRoleEntity);
        
        return $object;
    }
150384
public static function hydrate(stdClass $log)
    {
        $hydrated = new LogEntity();

        if (isset($log->id)) {
            $hydrated->setId($log->id);
        }

        if (isset($log->text)) {
            $hydrated->setText($log->text);
        }

        if (isset($log->level)) {
            $hydrated->setLevel($log->level);
        }

        if (isset($log->channel)) {
            $hydrated->setChannel($log->channel);
        }

        if (isset($log->request_uri)) {
            $hydrated->setRequestUri($log->request_uri);
        }

        if (isset($log->request_method)) {
            $hydrated->setRequestMethod($log->request_method);
        }

        if (isset($log->ip)) {
            $hydrated->setIp($log->ip);
        }

        if (isset($log->created_by)) {
            $hydrated->setCreatedBy(UserHydrator::hydrate($log->created_by));
        }

        if (isset($log->email)) {
            $hydrated->setEmail($log->email);
        }

        if (isset($log->organization)) {
            $hydrated->setOrganization(OrgHydrator::hydrate($log->organization));
        }

        if (isset($log->organization_name)) {
            $hydrated->setOrganizationName($log->organization_name);
        }

        if (isset($log->context)) {
            $hydrated->setContext($log->context);
        }

        if (isset($log->created_at)) {
            $hydrated->setCreatedAt(new DateTime($log->created_at));
        }

        if (isset($log->user_agent)) {
            $hydrated->setUserAgent($log->user_agent);
        }

        return $hydrated;
    }
1059777
public static function hydrate(stdClass $modification)
    {
        $hydrated = new ModificationEntity();

        if (isset($modification->id)) {
            $hydrated->setId($modification->id);
        }

        if (isset($modification->virtual_line)) {
            $hydrated->setVirtualLine($modification->virtual_line);
        }

        if (isset($modification->original_line)) {
            $hydrated->setOriginalLine($modification->original_line);
        }

        if (isset($modification->column_start)) {
            $hydrated->setColumnStart($modification->column_start);
        }

        if (isset($modification->column_end)) {
            $hydrated->setColumnEnd($modification->column_end);
        }

        if (isset($modification->content)) {
            $hydrated->setContent($modification->content);
        }

        if (isset($modification->highlighted_content)) {
            $hydrated->setHighlightedContent($modification->highlighted_content);
        }

        if (isset($modification->original_content)) {
            $hydrated->setOriginalContent($modification->original_content);
        }

        if (isset($modification->file)) {
            $hydrated->setFile(FileHydrator::hydrate($modification->file));
        }

        return $hydrated;
    }
1339597
public static function hydrate(stdClass $resource)
    {
        $hydrated = new ResourceEntity();

        if (isset($resource->id)) {
            $hydrated->setId($resource->id);
        }

        if (isset($resource->title)) {
            $hydrated->setTitle($resource->title);
        }

        if (isset($resource->author)) {
            $hydrated->setAuthor($resource->author);
        }

        if (isset($resource->url)) {
            $hydrated->setUrl($resource->url);
        }

        if (isset($resource->published_at)) {
            $hydrated->setPublishedAt(new DateTime($resource->published_at));
        }

        if (isset($resource->languages) && is_array($resource->languages)) {
            $hydrated->setLanguages(LanguageHydrator::hydrateCollection($resource->languages));
        }

        return $hydrated;
    }
384205
public static function hydrate(stdClass $java)
    {
        $hydrated = new JavaEntity();

        if (isset($java->id)) {
            $hydrated->setId($java->id);
        }

        if (isset($java->major_version)) {
            $hydrated->setMajorVersion($java->major_version);
        }

        if (isset($java->minor_version)) {
            $hydrated->setMinorVersion($java->minor_version);
        }

        if (isset($java->release_version)) {
            $hydrated->setReleaseVersion($java->release_version);
        }

        if (isset($java->implementation)) {
            $hydrated->setImplementation($java->implementation);
        }

        if (isset($java->setting)) {
            $hydrated->setSetting(SettingHydrator::hydrate($java->setting));
        }

        return $hydrated;
    }
1219665
public static function hydrate(stdClass $validator)
    {
        $hydrated = new ValidatorEntity();

        if (isset($validator->id)) {
            $hydrated->setId($validator->id);
        }

        if (isset($validator->class)) {
            $hydrated->setClass($validator->class);
        }

        if (isset($validator->method)) {
            $hydrated->setMethod($validator->method);
        }

        if (isset($validator->parameter)) {
            $hydrated->setParameter($validator->parameter);
        }

        if (isset($validator->characters)) {
            $hydrated->setCharacters($validator->characters);
        }

        if (isset($validator->issueType)) {
            $hydrated->setIssueType(TypeHydrator::hydrate($validator->issueType));
        }

        return $hydrated;
    }
589997
protected function hydrate(Repository $repository, array $data = array())
    {
        $repository->setCoverageMetrics($this->hydrator->hydrate(new CoverageMetrics(), $data, 'php_code_coverage'));
        $repository->setPdependMetrics($this->hydrator->hydrate(new PdependMetrics(), $data, 'pdepend'));
        $repository->setMetrics($this->hydrator->hydrate(new Metrics(), $data, 'scrutinizer'));

        return $repository;
    }