@param string $comment
@param array  $params

@throws \Http\Client\Exception

@return array
764835
public function update(string $comment, array $params = [])
    {
        $path = $this->buildCommentsPath($comment);

        return $this->put($path, $params);
    }
1355582
public function fillObject( $comment, $fieldNames = null )
    {
        $filledFields = $this->fields;
        if ( !is_null( $fieldNames ) && is_array( $fieldNames ) )
        {
            $filledFields = array();
            foreach ( $fieldNames as $fieldName )
            {
                $filledFields[$fieldName] = $this->fields[$fieldName];
            }
        }
        foreach ( $filledFields as $field => $fieldSetup )
        {
            $attributeName = $fieldSetup[self::ATTRIBUTENAME];
            if ( !is_null( $attributeName ) )
            {
                $fieldValue = $this->fieldValues[$field];
                $comment->setAttribute( $attributeName, $fieldValue );
            }
        }
    }
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
        ];
    }
805387
public function deserialize($data, ResourceComment $comment)
    {
        $this->sipe('id', 'setUuid', $data, $comment);
        $this->sipe('content', 'setContent', $data, $comment);

        if (isset($data['user']['id']) && !$comment->getUser()) {
            $user = $this->userRepo->findOneBy(['uuid' => $data['user']['id']]);

            if ($user) {
                $comment->setUser($user);
            }
        }
        if (isset($data['resourceNode']['id']) && !$comment->getResourceNode()) {
            $resourceNode = $this->resourceNodeRepo->findOneBy(['uuid' => $data['resourceNode']['id']]);

            if ($resourceNode) {
                $comment->setResourceNode($resourceNode);
            }
        }

        return $comment;
    }
845370
public function commitComments($ref, array $parameters = [])
    {
        $data = $this->client->repositories()->commitComments($this->id, $ref, $parameters);

        $comments = array();
        foreach ($data as $comment) {
            $comments[] = CommitNote::fromArray($this->getClient(), $comment);
        }

        return $comments;
    }
1374950
public function extractDoctrineTypeFromComment($comment, $currentType)
    {
        if ($comment !== null && preg_match('(\(DC2Type:(((?!\)).)+)\))', $comment, $match)) {
            return $match[1];
        }

        return $currentType;
    }
1133994
public function addComment(\Haven\CmsBundle\Entity\Comment $comment)
    {
        $comment->setContent($this);
        $this->comments[] = $comment;

        return $this;
    }
157352
public function destroy(Comment $comment)
    {
        $this->authorize($comment);

        $comment->delete();
        
        return $this->makeRedirect(true, 'admin.comments.index', __('msg.destroy'));
    }
682207
protected function _parse($comment) {
		$summary = null;
		$description = null;
		$tags = array();

		$comment = trim(preg_replace('/^(\s*\/\*\*|\s*\*{1,2}\/|\s*\* ?)/m', '', $comment));
		$comment = str_replace("\r\n", "\n", $comment);

		if ($items = preg_split('/\n@/ms', $comment, 2)) {
			list($summary, $tags) = $items + array('', '');
			$this->_tags = $tags ? $this->_parseTags("@{$tags}") : array();
		}
		if (strpos($summary, "\n\n")) {
			list($summary, $description) = explode("\n\n", $summary, 2);
		}
		$this->_summary = $this->_clean($summary);
		$this->_description = $this->_clean($description);
	}
113557
public function addComment($postId, $comment)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the success response code.
		$this->oauth->setOption('success_code', 201);

		// Set the API base
		$base = '/v1/posts/' . $postId . '/comments';

		// Build xml.
		$xml = '<comment><text>' . $comment . '</text></comment>';

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		$header['Content-Type'] = 'text/xml';

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);

		// Return the comment id.
		$response = explode('comments/', $response->headers['Location']);

		return $response[1];
	}
976915
function parseComment (comment) {
  const body = j('[' + comment + ']').nodes()[0].program.body
  const array = body[0].expression
  return array.elements
}
78245
public function deserialize($data, Comment $comment = null, User $user = null, array $options = [])
    {
        if (empty($comment)) {
            $comment = new Comment();
        }

        if (!in_array(Options::REFRESH_UUID, $options)) {
            $this->sipe('id', 'setUuid', $data, $comment);
        }

        if (isset($data['message'])) {
            $comment->setMessage($data['message']);
        }

        if (isset($data['creationDate'])) {
            $comment->setCreationDate(DateNormalizer::denormalize($data['creationDate']));
        } else {
            $comment->setCreationDate(new \DateTime());
        }

        if (isset($data['isPublished'])) {
            $comment->publish();
            if (isset($data['publicationDate'])) {
                $comment->setPublicationDate(DateNormalizer::denormalize($data['publicationDate']));
            } else {
                $comment->setPublicationDate(new \DateTime());
            }
        }

        if (isset($data['updateDate'])) {
            $comment->setUpdateDate(DateNormalizer::denormalize($data['updateDate']));
        }

        if (isset($data['reported'])) {
            $comment->setReported($data['reported']);
        }

        if ($user) {
            $comment->setAuthor($user);
        } elseif (isset($data['user'])) {
            $user = isset($data['user']['id']) ? $this->userRepo->findOneBy(['id' => $data['user']['id']]) : null;
            $comment->setAuthor($user);
        }

        return $comment;
    }
866092
public function spam(Comment &$comment)
    {
        $endpoint = '/admin/comments/'.$comment->id.'/spam.json';
        $response = $this->request($endpoint, 'POST');
        $comment->setData($response['comment']);
    }
82393
protected function extractTypeHintFromComment($comment)
    {
        if (empty($comment)) {
            return [null, null];
        }

        if (!preg_match('(\(DC2Type:(\w+)\))', $comment, $match)) {
            return [null, $comment];
        }

        $type    = $match[1];
        $comment = trim(str_replace('(DC2Type:' . $type . ')', '', $comment));

        if ($comment == '') {
            $comment = null;
        }

        return [$type, $comment];
    }
1282098
public static function parseComments($comments) {
        $ret = [];
        //trim(str_replace(array('/', '*', '**'), '', substr($comments, 0, strpos($comments, '@'))));
        $comments = str_replace(array('/*', '*', '**'), '', $comments);
        $array_comments = explode("\n", $comments);
        foreach ($array_comments as $k => $line) {
            $line = trim($line);
            if (self::startsWith($line, "@")) {
                $params = explode(" ", $line);
                $c = trim(str_replace("@", "", array_shift($params)));
                $ret[$c] = $params;
            }
        }
        return $ret;
    }
18139
private function createParam(Param $param, RefComment $comment = null)
    {
        $ref       = new RefParam();
        $ref->name = $param->var->name;

        if ($comment !== null) {
            $name = preg_quote($param->var->name, '/');
            if (preg_match('/@param\s+([^\s]+)\s+\$' . $name . '(?:\s*$|\s+(.*)$)/m', $comment->text, $matches)) {
                $ref->type        = $matches[1];
                $ref->description = isset($matches[2]) ? $matches[2] : null;
            }
        }

        if (!$ref->type) {
            $ref->type = $this->getTypeName($param->type);
        }

        $ref->byRef      = $param->byRef;
        $ref->isVariadic = $param->variadic;

        $ref->hasDefault = $param->default !== null;
        $ref->default    = $this->getValue($param->default);

        return $ref;
    }
1046903
public function addComment($comment)
    {
        if (is_string($comment)) {
            $comment = Placeholder::replaceCommentPlaceholders($comment, true);

            $this->comments[] = $comment;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($comment). "' for argument 'comment' given."
            );
        }

        return $this;
    }