@param array $metadata

@return string
545523
public function generateDocumentClass(array $metadata)
    {
        return implode(
            "\n",
            [
                "<?php\n",
                sprintf('namespace %s;', substr($metadata['name'], 0, strrpos($metadata['name'], '\\'))) . "\n",
                $this->generateDocumentUse($metadata),
                $this->generateDocumentDocBlock($metadata),
                'class ' . $this->getClassName($metadata),
                "{",
                str_replace('<spaces>', $this->spaces, $this->generateDocumentBody($metadata)),
                "}\n"
            ]
        );
    }
111191
public function transform(StreamMetaData $metadata): string
    {
        $newExpressionFinder = new NodeFinderVisitor([Node\Expr\New_::class]);

        // TODO: move this logic into walkSyntaxTree(Visitor $nodeVistor) method
        $traverser = new NodeTraverser();
        $traverser->addVisitor($newExpressionFinder);
        $traverser->traverse($metadata->syntaxTree);

        /** @var Node\Expr\New_[] $newExpressions */
        $newExpressions = $newExpressionFinder->getFoundNodes();

        if (empty($newExpressions)) {
            return self::RESULT_ABSTAIN;
        }

        foreach ($newExpressions as $newExpressionNode) {
            $startPosition = $newExpressionNode->getAttribute('startTokenPos');

            $metadata->tokenStream[$startPosition][1] = '\\' . __CLASS__ . '::getInstance()->{';
            if ($metadata->tokenStream[$startPosition+1][0] === T_WHITESPACE) {
                unset($metadata->tokenStream[$startPosition+1]);
            }
            $isExplicitClass  = $newExpressionNode->class instanceof Node\Name;
            $endClassNamePos  = $newExpressionNode->class->getAttribute('endTokenPos');
            $expressionSuffix = $isExplicitClass ? '::class}' : '}';
            $metadata->tokenStream[$endClassNamePos][1] .= $expressionSuffix;
        }

        return self::RESULT_TRANSFORMED;
    }
338744
protected function onMetaReceived($metaData)
    {
        foreach ($this->groupColumns as $column) {
            $metaData["columns"][$column]["method"] = "group";
        }
        foreach ($this->sumColumns as $column) {

            $metaData["columns"][$column]["method"] = "sum";
        }
        foreach ($this->countColumns as $column) {
            $metaData["columns"][$column]["method"] = "count";
            $metaData["columns"][$column]["type"] = "number";
        }
        foreach ($this->avgColumns as $column) {
            $metaData["columns"][$column]["method"] = "avg";
        }

        foreach ($this->minColumns as $column) {
            $metaData["columns"][$column]["method"] = "min";
        }
        foreach ($this->maxColumns as $column) {
            $metaData["columns"][$column]["method"] = "max";
        }
        return $metaData;
    }
165228
public function delete($metadata = array())
    {
        $this->setMetadata($metadata);

        return $this->filesystem->delete($this->key);
    }
827221
protected function generateDiscriminatorMapAnnotation($metadata)
    {
        if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) {
            $inheritanceClassMap = array();

            foreach ($metadata->discriminatorMap as $type => $class) {
                $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"';
            }

            return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})';
        }
    }
880375
protected function generateEntityClassName(ClassMetadataInfo $metadata)
    {
        return 'class ' . $this->getClassName($metadata) .
            ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null);
    }
486753
protected function generateInheritanceAnnotation($metadata)
    {
        if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) {
            return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
        }
    }
882005
protected function onMetaReceived($metaData)
    {
        if (is_array($this->params)) {
            foreach ($this->params as $columnName => $columnInfo) {
                if (isset($metaData["columns"][$columnName])) {
                    $newColumnName = Utility::get($columnInfo, "name");
                    $currentColumnInfo = $metaData["columns"][$columnName];
                    if ($newColumnName) {
                        unset($columnInfo["name"]);
                        unset($metaData["columns"][$columnName]);
                    }

                    if ($this->override) {
                        $metaData["columns"][($newColumnName) ? $newColumnName : $columnName] = $columnInfo;
                    } else {
                        $metaData["columns"][($newColumnName) ? $newColumnName : $columnName] = array_merge($currentColumnInfo, $columnInfo);
                    }
                }
            }
        } else if (is_callable($this->params)) {
            $func = $this->params;
            $columns = $metaData['columns'];
            $pos = 0;
            foreach ($columns as $c => $cMeta) {
                $newMeta = $func($c, $cMeta, $pos);
                if (isset($newMeta['name'])) {
                    $newName = $newMeta['name'];
                    $this->nameMap[$c] = $newName;
                    // unset($columns[$c]);
                    unset($newMeta['name']);
                    $columns[$newName] = $newMeta;
                } else {
                    $columns[$c] = $newMeta;
                }
                $pos++;
            }
            $metaData['columns'] = $columns;
        }
        return $metaData;
    }
628308
private function getFieldsDataFromMetadata(ClassMetadataInfo $metadata)
    {
        $fieldsData = (array) $metadata->fieldMappings;

        // Convert type to filter widget
        foreach ($fieldsData as $fieldName => $data) {
            $fieldsData[$fieldName]['fieldName'] = $fieldName;
            $fieldsData[$fieldName]['filterWidget'] = $this->getFilterType($fieldsData[$fieldName]['type'], $fieldName);
        }

        return $fieldsData;
    }
1316872
protected function onMetaReceived($metaData)
    {
        foreach ($this->params as $cName => $cParams) {
            $metaData["columns"][$cName] = array(
                "type" => "string",
            );
        }
        return $metaData;
    }
647743
protected function parseMeta($meta)
    {
        $fields = [];
        
        foreach ($meta as $key => $value) {
            $fields[] = [
                'title' => $key,
                'value' => $value,
            ];
        }
        
        return $fields;
    }
1241414
private function generateDocumentBody(array $metadata)
    {
        $lines = [];

        if ($properties = $this->generateDocumentProperties($metadata)) {
            $lines[] = $properties;
        }

        if ($this->hasMultipleEmbedded($metadata)) {
            $lines[] = $this->generateDocumentConstructor($metadata);
        }

        if ($methods = $this->generateDocumentMethods($metadata)) {
            $lines[] = $methods;
        }

        return rtrim(implode("\n", $lines));
    }
113825
private function getCacheLifetime($metadata)
    {
        $cacheLifetime = $metadata->cacheLifetime;

        if (!$cacheLifetime) {
            return null;
        }

        if (!is_array($cacheLifetime)
            || !isset($cacheLifetime['type'])
            || !isset($cacheLifetime['value'])
            || !$this->cacheLifetimeResolver->supports($cacheLifetime['type'], $cacheLifetime['value'])
        ) {
            throw new \InvalidArgumentException(
                sprintf('Invalid cachelifetime in article route default provider: %s', var_export($cacheLifetime, true))
            );
        }

        return $this->cacheLifetimeResolver->resolve($cacheLifetime['type'], $cacheLifetime['value']);
    }
601574
protected function mergeMeta(array $metadata)
    {
        $ret = static::$defaultMeta;

        $ret['uid'] = $this->uid->getUid();
        $ret['gid'] = $this->uid->getGid();

        $ret['mode'] = $metadata['type'] === 'dir' ? 040000 : 0100000;
        $ret['mode'] += $this->permissions[$metadata['type']][$metadata['visibility']];

        if (isset($metadata['size'])) {
            $ret['size'] = (int) $metadata['size'];
        }
        if (isset($metadata['timestamp'])) {
            $ret['mtime'] = (int) $metadata['timestamp'];
            $ret['ctime'] = (int) $metadata['timestamp'];
        }

        $ret['atime'] = time();

        return array_merge(array_values($ret), $ret);
    }
587838
public function searchByCustomMetadata($metadata)
    {
        $searchResult = $this->getRequest()->request(
            'POST',
            $this->getRequestUrl('searches'),
            $this->getSearchQuery([self::METADATA => $metadata])
        );

        return $this->getInputsFromSearchResult($searchResult);
    }
64763
private function getProperties(ClassMetadata $metadata)
    {
        return array_merge(
            $metadata->getFieldNames(),
            array_map(function (array $mapping) {
                return $mapping['fieldName'];
            }, $metadata->getEmbeddedFieldsMappings())
        );
    }
906678
public function fromData(array $metaData): ModuleConfiguration
    {
        $this->validateParameterFormat($metaData);

        $this->validator->validate(
            $metaData[MetaDataProvider::METADATA_FILEPATH],
            $metaData[MetaDataProvider::METADATA_METADATA_VERSION],
            $metaData[MetaDataProvider::METADATA_MODULE_DATA]
        );

        $mappedData = $this->getMappedData(
            $metaData[MetaDataProvider::METADATA_MODULE_DATA],
            $metaData[MetaDataProvider::METADATA_PATH],
            $metaData[MetaDataProvider::METADATA_CHECKSUM]
        );

        $moduleConfiguration = new ModuleConfiguration();
        $moduleConfiguration
            ->setMetaDataCheckSum($mappedData[MetaDataProvider::METADATA_CHECKSUM])
            ->setId($mappedData[MetaDataProvider::METADATA_ID])
            ->setTitle($mappedData[MetaDataProvider::METADATA_TITLE])
            ->setDescription($mappedData[MetaDataProvider::METADATA_DESCRIPTION])
            ->setLang($mappedData[MetaDataProvider::METADATA_LANG])
            ->setThumbnail($mappedData[MetaDataProvider::METADATA_THUMBNAIL])
            ->setAuthor($mappedData[MetaDataProvider::METADATA_AUTHOR])
            ->setUrl($mappedData[MetaDataProvider::METADATA_URL])
            ->setEmail($mappedData[MetaDataProvider::METADATA_EMAIL])
            ->setSettings($mappedData[MetaDataProvider::METADATA_SETTINGS]);

        return $moduleConfiguration;
    }