mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-11 08:59:46 +01:00
e587e3f4c6
Comments and doc comments are now saved in the 'comments' attribute, as an array. The are instances of PHPParser_Comment[_Doc].
42 lines
876 B
PHP
42 lines
876 B
PHP
<?php
|
|
|
|
class PHPParser_Comment
|
|
{
|
|
protected $text;
|
|
|
|
/**
|
|
* Constructs a comment node.
|
|
*
|
|
* @param string $text Comment text (including comment delimiters like /*)
|
|
*/
|
|
public function __construct($text) {
|
|
$this->text = $text;
|
|
}
|
|
|
|
/**
|
|
* Gets the comment text.
|
|
*
|
|
* @return string The comment text (including comment delimiters like /*)
|
|
*/
|
|
public function getText() {
|
|
return $this->text;
|
|
}
|
|
|
|
/**
|
|
* Sets the comment text.
|
|
*
|
|
* @param string $text The comment text (including comment delimiters like /*)
|
|
*/
|
|
public function setText($text) {
|
|
$this->text = $text;
|
|
}
|
|
|
|
/**
|
|
* Gets the comment text.
|
|
*
|
|
* @return string The comment text (including comment delimiters like /*)
|
|
*/
|
|
public function __toString() {
|
|
return $this->text;
|
|
}
|
|
} |