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 db5219b commit 864c3b1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ GeoIP database ChangeLog

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

## 1.1.0 / 2016-01-23

* Forward compatibility with XP7: Added dependencies on math and unittest
libraries.
libraries, rewrote getClassName() to `nameof()`.
(@thekid)

## 1.0.0 / 2015-12-14
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/maxmind/geoip/Location.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function attribute($name) {
*/
public function toString() {
$tz= isset($this->attr['time_zone']) ? '; tz= '.$this->attr['time_zone'] : '';
return $this->getClassName().'('.$this->lat.','.$this->long.$tz.')';
return nameof($this).'('.$this->lat.','.$this->long.$tz.')';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/com/maxmind/geoip/Name.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ public function name($lang= 'en') {
*/
public function toString() {
$code= null === $this->code ? '' : '; code= '.$this->code;
return $this->getClassName().'(#'.$this->id.': '.$this->name('en').$code.')';
return nameof($this).'(#'.$this->id.': '.$this->name('en').$code.')';
}
}
2 changes: 1 addition & 1 deletion src/main/php/com/maxmind/geoip/Record.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function toString() {
" [location ] %s\n".
" [subdivisions] %s\n".
"}",
$this->getClassName(),
nameof($this),
\xp::stringOf($this->city()),
\xp::stringOf($this->country()),
\xp::stringOf($this->continent()),
Expand Down

0 comments on commit 864c3b1

Please sign in to comment.