Returns a build Property line.
@access		protected
@param		string		$key			Key of  Property
@param		string		$value			Value of Property
@param		string		$comment		Comment of Property
@return		string
541124
protected function buildLine( $key, $value, $comment )
	{
		$breaksKey		= 4 - floor( strlen( $key ) / 8 );
		$breaksValue	= 4 - floor( strlen( $value ) / 8 );
		if( $breaksKey < 1 )
			$breaksKey = 1;
		if( $breaksValue < 1 )
			$breaksValue = 1;
		$line = $key.str_repeat( "\t", $breaksKey )."=".$value;
		if( $comment )
			$line .= str_repeat( "\t", $breaksValue )."; ".$comment;
		return $line;
	}
509534
public function setComment( $key, $comment, $section = NULL )
	{
		if( $this->usesSections() )
		{
			if( !$this->hasProperty( $key, $section ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing in Section "'.$section.'".' );
			$this->comments[$section][$key] = $comment;
		}
		else
		{
			if( !$this->hasProperty( $key ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing' );
			$this->comments[$key] = $comment;
		}
		return is_int( $this->write() );
	}
749750
private function fetchValueForKey($key, $value)
    {
        if (in_array($key, $this->getDates())) {
            return trim($value) === '' ? null : $value;
        }

        if (! $this->hasSetMutator($key)) {
            $value = $this->getAttribute($key);
        }

        if ($this->isJsonCastable($key) && ! is_null($value)) {
            $value = is_string($value) ? $this->getJsonCastValue($value) : $value;
        }

        return $value;
    }
362665
protected function parseEnvLine($line, &$key, &$value)
    {
        $parseOk = false;

        $keyExpr = '/(^\S+)\s*=\s*/';
        if (preg_match($keyExpr, $line, $matched) === 1) {
            $key = $matched[1];
            $value = substr($line, strlen($matched[0]));
            $parseOk = true;
        }

        return $parseOk;
    }
17829
private function compileToken($value)
    {
        foreach ($this->tokens as $token) {
            $out = $this->{'compile'.$token}($value);

            if ($token == 'Comments') {
                if (strlen($out) == 0) {
                    return "";
                }
            }

            if (strlen($out) !== 0) {
                $value = $out;
            }
        }

        return $value;
    }
738021
protected function compileComments($value)
    {
        $pattern = sprintf('/%s(.*?)%s/', $this->comments[0], $this->comments[1]);
        
        return preg_replace($pattern, '', $value);
    }
1163720
protected function getWsdlElementAttributes($comment)
    {
        $nillable = $minOccurs = $maxOccurs = null;
        if (preg_match('/{(.+)}/', $comment, $attr)) {
            if (preg_match_all('/((\w+)\s*=\s*(\w+))/mi', $attr[1], $attr)) {
                foreach ($attr[2] as $id => $prop) {
                    $prop = strtolower($prop);
                    $val = strtolower($attr[3][$id]);
                    if ($prop == 'nillable') {
                        if ($val == 'false' || $val == 'true') {
                            $nillable = $val;
                        } else {
                            $nillable = $val ? 'true' : 'false';
                        }
                    } elseif ($prop == 'minoccurs') {
                        $minOccurs = intval($val);
                    } elseif ($prop == 'maxoccurs') {
                        $maxOccurs = ($val == 'unbounded') ? 'unbounded' : intval($val);
                    }
                }
            }
        }
        return [
            'nillable' => $nillable,
            'minOccurs' => $minOccurs,
            'maxOccurs' => $maxOccurs
        ];
    }
418467
public function GetComment($key) {
        $resources = $this->GetList();
        $keyExist = array_key_exists($key, $resources);
        if ($keyExist) {
            return $resources[$key][\Puzzlout\Framework\BO\F_common_resource::F_COMMON_RESOURCE_COMMENT];
        } else {
//      throw new \Puzzlout\Framework\Exceptions\ResourceNotFoundException(
//      "The resource comment doesn't exist for Group => " . $this->GroupValue . " and Key => " . $key, 0, null);
            return "???";
        }
    }
1328333
public static function extractFunctionDocblockInfo($comment, $line_number)
    {
        $comments = DocComment::parse($comment, $line_number);

        $info = new FunctionDocblockComment();

        if (isset($comments['specials']['return']) || isset($comments['specials']['psalm-return'])) {
            /** @var array<int, string> */
            $return_specials = isset($comments['specials']['psalm-return'])
                ? $comments['specials']['psalm-return']
                : $comments['specials']['return'];

            self::extractReturnType((string) reset($return_specials), array_keys($return_specials)[0], $info);
        }

        if (isset($comments['specials']['param']) || isset($comments['specials']['psalm-param'])) {
            $all_params = (isset($comments['specials']['param']) ? $comments['specials']['param'] : [])
                + (isset($comments['specials']['psalm-param']) ? $comments['specials']['psalm-param'] : []);

            /** @var string $param */
            foreach ($all_params as $line_number => $param) {
                $line_parts = self::splitDocLine($param);

                if (count($line_parts) === 1 && isset($line_parts[0][0]) && $line_parts[0][0] === '$') {
                    continue;
                }

                if (count($line_parts) > 1) {
                    if (!preg_match('/\[[^\]]+\]/', $line_parts[0])
                        && preg_match('/^&?(\.\.\.)?&?\$[A-Za-z0-9_]+,?$/', $line_parts[1])
                        && $line_parts[0][0] !== '{'
                    ) {
                        $line_parts[1] = str_replace('&', '', $line_parts[1]);

                        if ($line_parts[0][0] === '$' && !preg_match('/^\$this(\||$)/', $line_parts[0])) {
                            throw new IncorrectDocblockException('Misplaced variable');
                        }

                        $line_parts[1] = preg_replace('/,$/', '', $line_parts[1]);

                        $info->params[] = [
                            'name' => $line_parts[1],
                            'type' => $line_parts[0],
                            'line_number' => (int)$line_number,
                        ];
                    }
                } else {
                    throw new DocblockParseException('Badly-formatted @param');
                }
            }
        }

        if (isset($comments['specials']['param-out'])) {
            /** @var string $param */
            foreach ($comments['specials']['param-out'] as $line_number => $param) {
                $line_parts = self::splitDocLine($param);

                if (count($line_parts) === 1 && isset($line_parts[0][0]) && $line_parts[0][0] === '$') {
                    continue;
                }

                if (count($line_parts) > 1) {
                    if (!preg_match('/\[[^\]]+\]/', $line_parts[0])
                        && preg_match('/^(\.\.\.)?&?\$[A-Za-z0-9_]+,?$/', $line_parts[1])
                        && $line_parts[0][0] !== '{'
                    ) {
                        if ($line_parts[1][0] === '&') {
                            $line_parts[1] = substr($line_parts[1], 1);
                        }

                        if ($line_parts[0][0] === '$' && !preg_match('/^\$this(\||$)/', $line_parts[0])) {
                            throw new IncorrectDocblockException('Misplaced variable');
                        }

                        $line_parts[1] = preg_replace('/,$/', '', $line_parts[1]);

                        $info->params_out[] = [
                            'name' => $line_parts[1],
                            'type' => $line_parts[0],
                            'line_number' => (int)$line_number,
                        ];
                    }
                } else {
                    throw new DocblockParseException('Badly-formatted @param');
                }
            }
        }

        if (isset($comments['specials']['global'])) {
            foreach ($comments['specials']['global'] as $line_number => $global) {
                $line_parts = self::splitDocLine($global);

                if (count($line_parts) === 1 && isset($line_parts[0][0]) && $line_parts[0][0] === '$') {
                    continue;
                }

                if (count($line_parts) > 1) {
                    if (!preg_match('/\[[^\]]+\]/', $line_parts[0])
                        && preg_match('/^(\.\.\.)?&?\$[A-Za-z0-9_]+,?$/', $line_parts[1])
                        && $line_parts[0][0] !== '{'
                    ) {
                        if ($line_parts[1][0] === '&') {
                            $line_parts[1] = substr($line_parts[1], 1);
                        }

                        if ($line_parts[0][0] === '$' && !preg_match('/^\$this(\||$)/', $line_parts[0])) {
                            throw new IncorrectDocblockException('Misplaced variable');
                        }

                        $line_parts[1] = preg_replace('/,$/', '', $line_parts[1]);

                        $info->globals[] = [
                            'name' => $line_parts[1],
                            'type' => $line_parts[0],
                            'line_number' => (int)$line_number,
                        ];
                    }
                } else {
                    throw new DocblockParseException('Badly-formatted @param');
                }
            }
        }

        if (isset($comments['specials']['deprecated'])) {
            $info->deprecated = true;
        }

        if (isset($comments['specials']['internal'])) {
            $info->internal = true;
        }

        if (isset($comments['specials']['psalm-suppress'])) {
            foreach ($comments['specials']['psalm-suppress'] as $suppress_entry) {
                $info->suppress[] = preg_split('/[\s]+/', $suppress_entry)[0];
            }
        }

        if (isset($comments['specials']['throws'])) {
            foreach ($comments['specials']['throws'] as $throws_entry) {
                $throws_class = preg_split('/[\s]+/', $throws_entry)[0];

                if (!$throws_class) {
                    throw new IncorrectDocblockException('Unexpectedly empty @throws');
                }

                $info->throws[] = $throws_class;
            }
        }

        if (strpos(strtolower($comments['description']), '@inheritdoc') !== false
            || isset($comments['specials']['inheritdoc']) || isset($comments['specials']['inheritDoc'])) {
            $info->inheritdoc = true;
        }

        if (isset($comments['specials']['template']) || isset($comments['specials']['psalm-template'])) {
            $all_templates = (isset($comments['specials']['template']) ? $comments['specials']['template'] : [])
                + (isset($comments['specials']['psalm-template']) ? $comments['specials']['psalm-template'] : []);

            foreach ($all_templates as $template_line) {
                $template_type = preg_split('/[\s]+/', $template_line);

                if (count($template_type) > 2
                    && in_array(strtolower($template_type[1]), ['as', 'super', 'of'], true)
                ) {
                    $info->templates[] = [
                        $template_type[0],
                        strtolower($template_type[1]), $template_type[2]
                    ];
                } else {
                    $info->templates[] = [$template_type[0]];
                }
            }
        }

        if (isset($comments['specials']['template-typeof'])) {
            foreach ($comments['specials']['template-typeof'] as $template_typeof) {
                $typeof_parts = preg_split('/[\s]+/', $template_typeof);

                if (count($typeof_parts) < 2 || $typeof_parts[1][0] !== '$') {
                    throw new IncorrectDocblockException('Misplaced variable');
                }

                $info->template_typeofs[] = [
                    'template_type' => $typeof_parts[0],
                    'param_name' => substr($typeof_parts[1], 1),
                ];
            }
        }

        if (isset($comments['specials']['psalm-assert'])) {
            foreach ($comments['specials']['psalm-assert'] as $assertion) {
                $assertion_parts = preg_split('/[\s]+/', $assertion);

                if (count($assertion_parts) < 2 || $assertion_parts[1][0] !== '$') {
                    throw new IncorrectDocblockException('Misplaced variable');
                }

                $info->assertions[] = [
                    'type' => $assertion_parts[0],
                    'param_name' => substr($assertion_parts[1], 1),
                ];
            }
        }

        if (isset($comments['specials']['psalm-assert-if-true'])) {
            foreach ($comments['specials']['psalm-assert-if-true'] as $assertion) {
                $assertion_parts = preg_split('/[\s]+/', $assertion);

                if (count($assertion_parts) < 2 || $assertion_parts[1][0] !== '$') {
                    throw new IncorrectDocblockException('Misplaced variable');
                }

                $info->if_true_assertions[] = [
                    'type' => $assertion_parts[0],
                    'param_name' => substr($assertion_parts[1], 1),
                ];
            }
        }

        if (isset($comments['specials']['psalm-assert-if-false'])) {
            foreach ($comments['specials']['psalm-assert-if-false'] as $assertion) {
                $assertion_parts = preg_split('/[\s]+/', $assertion);

                if (count($assertion_parts) < 2 || $assertion_parts[1][0] !== '$') {
                    throw new IncorrectDocblockException('Misplaced variable');
                }

                $info->if_false_assertions[] = [
                    'type' => $assertion_parts[0],
                    'param_name' => substr($assertion_parts[1], 1),
                ];
            }
        }

        $info->variadic = isset($comments['specials']['psalm-variadic']);
        $info->ignore_nullable_return = isset($comments['specials']['psalm-ignore-nullable-return']);
        $info->ignore_falsable_return = isset($comments['specials']['psalm-ignore-falsable-return']);

        return $info;
    }
1096919
protected function compilePropertyDefinitions(ClassBuilder $builder, StreamWriter $writer)
    {
        foreach ($builder->getProperties() as $property) {
            /* @var PropertyBuilder $property */

            $writer->indent()->writeLine('/**');
            $comments = $property->getComments();
            if (count($comments)) {
                foreach ($comments as $comment) {
                    $comment = trim(ltrim($comment, '>'));
                    $writer->indent()->write(' * ')->writeLine($comment);
                }
                $writer->indent()
                    ->write(' * ')
                    ->writeLine();
            }
            $writer->indent()->write(' * @var');
            if ($type = $property->getType()) {
                $writer->write(' ' . $property->getType());
            }
            $writer->write(' $' . $property->getName())
                ->writeLine()
                ->indent()->writeLine(' */');

            $writer->indent()
                ->write($property->getVisibility())
                ->write(' ')
                ->writeLine('$'.$property->getName().';')
                ->writeLine();
        }

        $writer->writeLine();
    }
681838
protected function applyStdWrap($key, $value)
    {
        $key .= '.';

        if (empty($this->stdWrapList[$key])) {
            return $value;
        }

        return $this->cObj->stdWrap($value, $this->stdWrapList[$key]);
    }
926538
public static String commentLine( String line ) {

		String result = line;
		if( ! Utils.isEmptyOrWhitespaces( line )
				&& ! line.trim().startsWith( ParsingConstants.COMMENT_DELIMITER ))
			result = ParsingConstants.COMMENT_DELIMITER + line;

		return result;
	}
1138379
function(comment){
    var ast = [];
    if (!comment.buffer) return;
    if (this.pp) push.apply(ast, this.prettyIndent(1, true));
    push.apply(ast, this.buffer('<!--' + comment.val + '-->'));
    return ast;
  }
950349
public function addNodeProperty($key, $value)
    {
        if (is_string($value)) {
            $value = '"'.htmlentities($value, ENT_QUOTES, 'UTF-8').'"';
        } elseif (is_int($value)) {
            $value = 'toInt('.$value.')';
        }

        return $key.':'.$value;
    }
713738
public static String getTextFromComment(Comment comment) {
    switch (comment.getStyle()) {
      case BLOCK:
        return comment.getText().replaceAll("^\\s*/\\*\\s*(.*?)\\s*\\*/\\s*", "$1");
      case LINE:
        return comment.getText().replaceAll("^\\s*//\\s*", "");
      default:
        return comment.getText();
    }
  }
372366
protected function _buildAttr($key, $val)
    {
        $return = null;
        if (!empty($val) || $val === '0' || $key === 'value') {
            $return = ' ' . $key . '="' . $val . '"';
        }

        return $return;
    }
3680
public static function reflectClassProperty($class, $property, $output = true)
    {
        $data = '';

        $reflectionClass    = new \ReflectionClass($class);
        $reflectionProperty = new \ReflectionProperty($class, $property);

        $defaultPropertyValues = $reflectionClass->getDefaultProperties();

        $comment = $reflectionProperty->getDocComment();
        if (!empty($comment)) {
            $data .= "\n";
            $data .= "\t";
            $data .= $comment;
        }

        $data .= "\n";
        $data .= "\t";
        $data .= ($reflectionProperty->isPublic() ? 'public ' : '');
        $data .= ($reflectionProperty->isPrivate() ? 'private ' : '');
        $data .= ($reflectionProperty->isProtected() ? 'protected ' : '');
        $data .= ($reflectionProperty->isStatic() ? 'static ' : '');
        $data .= '$' . $reflectionProperty->name;
        if (isset($defaultPropertyValues[$property])) {
            $data .= ' = ' . self::getDebugInformation($defaultPropertyValues[$property]);
        }
        $data .= ';';

        if ($output) {
            self::output($data);
        }

        return $data;
    }