/** * @param object|array|Iterator|null $data * @param DataAnalyzerInterface $analyzer * @param EncodingParametersInterface|null $parameters * * @return EncodingParametersInterface */ private function getEncodingParameters($data, DataAnalyzerInterface $analyzer, $parameters = null) { /** @var bool $isDataEmpty */ /** @var SchemaProviderInterface $schema */ list($isDataEmpty, , $schema) = $analyzer->analyze($data); if ($isDataEmpty === true) { return $this->factory->createEncodingParameters(); } elseif ($parameters !== null && $parameters->getIncludePaths() !== null) { return $parameters; } else { $includePaths = $schema->getIncludePaths(); $fieldSets = $parameters === null ? null : $parameters->getFieldSets(); return $this->factory->createEncodingParameters($includePaths, $fieldSets); } }
/** * @return array */ protected function analyzeCurrentData() { $relationship = $this->stack->end()->getRelationship(); $data = $relationship->isShowData() === true ? $relationship->getData() : null; return $this->dataAnalyzer->analyze($data); }