mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-17 07:08:14 +01:00
Remove Node::setLine() method
This commit is contained in:
parent
56d57d472a
commit
92275bdfa8
@ -57,6 +57,8 @@ source code, while running on a newer version.
|
|||||||
* The `ClassConst::isStatic()` method has been removed. Constants cannot have a static modifier.
|
* The `ClassConst::isStatic()` method has been removed. Constants cannot have a static modifier.
|
||||||
* The `NodeTraverser` no longer accepts `false` as a return value from a `leaveNode()` method.
|
* The `NodeTraverser` no longer accepts `false` as a return value from a `leaveNode()` method.
|
||||||
`NodeTraverser::REMOVE_NODE` should be returned instead.
|
`NodeTraverser::REMOVE_NODE` should be returned instead.
|
||||||
|
* The `Node::setLine()` method has been removed. If you really need to, you can use `setAttribute()`
|
||||||
|
instead.
|
||||||
* The misspelled `Class_::VISIBILITY_MODIFER_MASK` constant has been dropped in favor of
|
* The misspelled `Class_::VISIBILITY_MODIFER_MASK` constant has been dropped in favor of
|
||||||
`Class_::VISIBILITY_MODIFIER_MASK`.
|
`Class_::VISIBILITY_MODIFIER_MASK`.
|
||||||
* The XML serializer has been removed. As such, the classes `Serializer\XML`, and
|
* The XML serializer has been removed. As such, the classes `Serializer\XML`, and
|
||||||
|
@ -25,15 +25,6 @@ interface Node
|
|||||||
*/
|
*/
|
||||||
public function getLine() : int;
|
public function getLine() : int;
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets line the node started in.
|
|
||||||
*
|
|
||||||
* @param int $line Line
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
public function setLine(int $line);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the doc comment of the node.
|
* Gets the doc comment of the node.
|
||||||
*
|
*
|
||||||
|
@ -33,17 +33,6 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|||||||
return $this->getAttribute('startLine', -1);
|
return $this->getAttribute('startLine', -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets line the node started in.
|
|
||||||
*
|
|
||||||
* @param int $line Line
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
public function setLine(int $line) {
|
|
||||||
$this->setAttribute('startLine', (int) $line);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the doc comment of the node.
|
* Gets the doc comment of the node.
|
||||||
*
|
*
|
||||||
|
@ -98,10 +98,6 @@ class NodeAbstractTest extends TestCase
|
|||||||
* @dataProvider provideNodes
|
* @dataProvider provideNodes
|
||||||
*/
|
*/
|
||||||
public function testChange(array $attributes, Node $node) {
|
public function testChange(array $attributes, Node $node) {
|
||||||
// change of line
|
|
||||||
$node->setLine(15);
|
|
||||||
$this->assertSame(15, $node->getLine());
|
|
||||||
|
|
||||||
// direct modification
|
// direct modification
|
||||||
$node->subNode = 'newValue';
|
$node->subNode = 'newValue';
|
||||||
$this->assertSame('newValue', $node->subNode);
|
$this->assertSame('newValue', $node->subNode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user