Skip to content

Commit

Permalink
Remove Node::setLine() method
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Apr 29, 2017
1 parent 56d57d4 commit 92275bd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
2 changes: 2 additions & 0 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `NodeTraverser` no longer accepts `false` as a return value from a `leaveNode()` method.
`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
`Class_::VISIBILITY_MODIFIER_MASK`.
* The XML serializer has been removed. As such, the classes `Serializer\XML`, and
Expand Down
9 changes: 0 additions & 9 deletions lib/PhpParser/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ public function getSubNodeNames() : array;
*/
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.
*
Expand Down
11 changes: 0 additions & 11 deletions lib/PhpParser/NodeAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@ public function getLine() : int {
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.
*
Expand Down
4 changes: 0 additions & 4 deletions test/PhpParser/NodeAbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ public function testSetDocComment() {
* @dataProvider provideNodes
*/
public function testChange(array $attributes, Node $node) {
// change of line
$node->setLine(15);
$this->assertSame(15, $node->getLine());

// direct modification
$node->subNode = 'newValue';
$this->assertSame('newValue', $node->subNode);
Expand Down

0 comments on commit 92275bd

Please sign in to comment.