creates the property file lines for the given comments array

@param array $comments
@return string
3607
public function createPropertyPathsFromCommentArray($comments)
    {
        $out = '';

        foreach ($comments as $mainKey => $subKeys) {
            foreach ($subKeys as $subKey => $comment) {
                // uncommented entries are undocumented & for internal use only (I guess)
                if ('' === $comment) {
                    continue;
                }

                $defaultConfigurationValue = $this->defaultConfiguration[$mainKey][$subKey];

                // non-scalar values are not available in InstallTool (& also not handled by phing properties)
                if (FALSE === is_scalar($defaultConfigurationValue)) {
                    continue;
                }

                $out .= strtr($this->outputLine, array(
                    '%newline%' => chr(10),
                    '%comment%' => $comment,
                    '%mainKey%' => $mainKey,
                    '%subKey%' => $subKey,
                    '%defaultConfigurationValue%' => $defaultConfigurationValue,
                ));
            }
        }

        return $out;
    }
964998
def comment_lines(lines):
    """"""
    ret = []
    for line in lines:
        ws_prefix, rest, ignore = RE_LINE_SPLITTER_COMMENT.match(line).groups()
        ret.append(ws_prefix + '#' + rest)
    return ''.join(ret)
823725
protected function extractVisibility($comments = '')
    {
        $visible = TRUE;
        preg_match('/@visible\ (true|false)\n/i', $comments, $visibility);
        if (count($visibility)) {
            $visible = !('false' === $visibility[1]);
        }

        return $visible;
    }
1292706
public static function lines(string ...$lines): string
    {
        $head = true;
        return join(
                '',
                array_map(
                        function($line) use (&$head)
                        {
                            if (empty($line) && $head) {
                                $head = false;
                                return self::emptyLine();
                            }

                            if ($head) {
                                return self::line($line);
                            }

                            return $line;
                        },
                        $lines
                )
        );
    }
1217380
public function convertLinesToCode(array $lines) {
        if (0 === count($lines)) {
            return '';
        }

        if (0 !== strlen($this->getTemplate()->getIndentationPrefix())) {
            foreach ($lines as $lineNumber => $line) {
                if (null === $line) {
                    unset($lines[$lineNumber]);
                } elseif ('' === trim($line)) {
                    $lines[$lineNumber] = '';
                }
            }
        }

        return implode($this->getTemplate()->getEol(), $lines) . $this->getTemplate()->getEol();
    }
109255
public function getLines()
    {
        $lines = explode(PHP_EOL, $this->comment);

        $wrapper = function($line)
        {
            return new Line($line);
        };

        return array_map($wrapper, $lines);
    }
389213
public function buildPropertiesString(array $properties)
    {
        $chunks = array();

        foreach ($properties as $property) {
            $chunks[] = $property->toString();
        }

        return implode(' ', $chunks);
    }
1227169
public function write( $fileName )
	{
		$lines	= array();
		if( $this->useSections )
		{
			foreach( $this->data as $section => $sectionPairs )
			{
				$lines[]	= "[".$section."]";
				foreach ( $sectionPairs as $key => $data )
				{
					$value		= $data['value'];
					$comment	= $data['comment'];
					$lines[]	= $this->buildLine( $key, $value, $comment);
				}
				$lines[]	= "";
			}
		}
		else
		{
			foreach( $this->data as $key => $data )
			{
				$value		= $data['value'];
				$comment	= $data['comment'];
				$lines[]	= $this->buildLine( $key, $value, $comment);
			}
			$lines[]	= "";
		}
		$file		= new FS_File_Writer( $fileName, 0664 );
		return $file->writeArray( $lines );
	}
1050744
public static function create($comment) {
    $comment = trim($comment);
    $lines = array_map('trim', explode("\n", $comment));
    $text = "/**\n";
    foreach ($lines as $i => $line) {
      $text .= ' * ' . $line . "\n";
    }
    $text .= ' */';
    return new DocCommentNode(T_DOC_COMMENT, $text);
  }
757274
private function getLine(array $fields): string
    {
        $fields = $this->quoteFields($fields);

        return $this->sEnclosure.implode($this->sEnclosure.$this->sDelimiter.$this->sEnclosure, $fields).$this->sEnclosure;
    }
552741
protected function buildCommentsPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'pullrequests', $this->pr, 'comments', ...$parts);
    }
628311
public function renderHeader(array $comments = []) : void
    {
        if ($this->isSilent()) {
            return;
        }

        $this->logger->debug('rendering comments');

        fwrite($this->file, '  "comments": [' . PHP_EOL);

        foreach ($comments as $i => $text) {
            fwrite($this->file, '    ' . json_encode($text));

            if ($i < (count($comments) - 1)) {
                fwrite($this->file, ',');
            }

            fwrite($this->file, PHP_EOL);
        }

        fwrite($this->file, '  ],' . PHP_EOL);
    }
1100385
public function setComments($comments)
    {
        foreach ($comments as $comment) {
            $comment->setPortfolio($this);
        }

        $this->comments = $comments;

        return $this;
    }
413648
public function serialize(ResourceComment $comment, array $options = [])
    {
        $serialized = [
            'id' => $comment->getUuid(),
            'content' => $comment->getContent(),
            'user' => $comment->getUser() ? $this->userSerializer->serialize($comment->getUser(), [Options::SERIALIZE_MINIMAL]) : null,
            'creationDate' => $comment->getCreationDate() ? DateNormalizer::normalize($comment->getCreationDate()) : null,
            'editionDate' => $comment->getEditionDate() ? DateNormalizer::normalize($comment->getEditionDate()) : null,
        ];

        return $serialized;
    }
84526
private function getIndent(array $lines)
    {
        $detector = new IndentationDetector(
            LineCollection::createFromArray($lines)
        );

        return str_repeat(' ', $detector->getFirstLineIndentation());
    }
764835
public function update(string $comment, array $params = [])
    {
        $path = $this->buildCommentsPath($comment);

        return $this->put($path, $params);
    }
30192
public static function getTags(string $comment, array $ignored = ['param', 'return']): array
    {
        $comment = str_replace("\r\n", "\n", trim($comment, "/ \n"));
        $comment = "@Description \n" . str_replace("\r", '',
                trim(preg_replace('/^\s*\**( |\t)?/m', '', $comment))
            );

        $tags = [];
        $parts = preg_split('/^\s*@/m', $comment, -1, PREG_SPLIT_NO_EMPTY);

        foreach ($parts as $part) {
            if (preg_match('/^(\w+)(.*)/ms', trim($part), $matches)) {
                $name = $matches[1];
                if (\in_array($name, $ignored, true)) {
                    continue;
                }

                if (!isset($tags[$name])) {
                    $tags[$name] = trim($matches[2]);
                } elseif (\is_array($tags[$name])) {
                    $tags[$name][] = trim($matches[2]);
                } else {
                    $tags[$name] = [$tags[$name], trim($matches[2])];
                }
            }
        }

        return $tags;
    }