Skip to content

Commit

Permalink
Use nameof() instead of the deprecated getClassName()
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Jan 23, 2016
1 parent 9fac83f commit 4689317
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 8 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Mustache for XP Framework ChangeLog

## ?.?.? / ????-??-??

## 2.0.2 / 2016-01-23

* Fix code to use `nameof()` instead of the deprecated `getClassName()`
method from lang.Generic. See xp-framework/core#120
(@thekid)

## 2.0.1 / 2015-12-20

* Declared dependency on xp-framework/tokenize and xp-framework/unittest,
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"keywords": ["module", "xp"],
"require" : {
"xp-framework/core": "^6.5",
"xp-framework/tokenize": "^6.6",
"php" : ">=5.5.0"
},
"require-dev": {
"xp-framework/unittest": "^6.5",
"xp-forge/json": ">=0.8.4"
},
"autoload" : {
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/github/mustache/CommentNode.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct($text) {
* @return string
*/
public function toString() {
return $this->getClassName().'("'.addcslashes($this->text, "\0..\17").'")';
return nameof($this).'("'.addcslashes($this->text, "\0..\17").'")';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/github/mustache/IteratorNode.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function escaped() {
* @return string
*/
public function toString() {
return $this->getClassName().'{{'.($this->escape ? '' : '& ').'.}}';
return nameof($this).'{{'.($this->escape ? '' : '& ').'.}}';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/github/mustache/NodeList.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function nodes() {
* @return string
*/
public function toString() {
return $this->getClassName().'@'.\xp::stringOf($this->nodes);
return nameof($this).'@'.\xp::stringOf($this->nodes);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/github/mustache/PartialNode.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function template() {
* @return string
*/
public function toString() {
return $this->getClassName().'{{> '.$this->name.'}}, indent= "'.$this->indent.'"';
return nameof($this).'{{> '.$this->name.'}}, indent= "'.$this->indent.'"';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/github/mustache/SectionNode.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function optionString() {
* @return string
*/
public function toString() {
return $this->getClassName().'('.($this->invert ? '^' : '#').$this->name.$this->optionString().') -> '.\xp::stringOf($this->nodes);
return nameof($this).'('.($this->invert ? '^' : '#').$this->name.$this->optionString().') -> '.\xp::stringOf($this->nodes);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/github/mustache/Template.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function root() {
* @return string
*/
public function toString() {
return $this->getClassName().'(source= '.$this->source.')@'.\xp::stringOf($this->root);
return nameof($this).'(source= '.$this->source.')@'.\xp::stringOf($this->root);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/github/mustache/TextNode.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function text() {
* @return string
*/
public function toString() {
return $this->getClassName().'("'.addcslashes($this->text, "\0..\17").'")';
return nameof($this).'("'.addcslashes($this->text, "\0..\17").'")';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/github/mustache/VariableNode.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function optionString() {
* @return string
*/
public function toString() {
return $this->getClassName().'{{'.($this->escape ? '' : '& ').$this->name.$this->optionString().'}}';
return nameof($this).'{{'.($this->escape ? '' : '& ').$this->name.$this->optionString().'}}';
}

/**
Expand Down

0 comments on commit 4689317

Please sign in to comment.