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 dc17e5e commit a969a67
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 11 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 @@ Imaging APIs for the XP Framework ChangeLog

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

## 6.1.1 / 2016-01-23

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

## 6.1.0 / 2015-12-14

* **Heads up**: Changed minimum XP version to XP 6.5.0, and with it the
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/Color.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function toHex() {
public function toString() {
return sprintf(
'%s@(%03d, %03d, %03d)',
$this->getClassName(),
nameof($this),
$this->red,
$this->green,
$this->blue
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/Image.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public function hashCode() {
public function toString() {
return sprintf(
"%s(%dx%d) {\n #colors = %s\n}",
$this->getClassName(),
nameof($this),
$this->width,
$this->height,
imageistruecolor($this->handle) ? '(truecolor)' : imagecolorstotal($this->handle)
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/io/CommentSegment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function text() {
* @return string
*/
public function toString() {
return $this->getClassName().'<'.$this->marker.'>'.\xp::stringOf($this->text);
return nameof($this).'<'.$this->marker.'>'.\xp::stringOf($this->text);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/io/ExifSegment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ public function rawData($arg= null) {
* @return string
*/
public function toString() {
return $this->getClassName().'<'.$this->marker.'>'.\xp::stringOf($this->data);
return nameof($this).'<'.$this->marker.'>'.\xp::stringOf($this->data);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/io/ImageMetaData.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function segmentsOf($type) {
$class= $type instanceof \lang\XPClass ? $type->getName() : $type;
$r= [];
foreach ($this->segments as $segment) {
if ($segment->getClassName() === $class) $r[]= $segment;
if (nameof($segment) === $class) $r[]= $segment;
}
return $r;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/io/IptcSegment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function rawData() {
* @return string
*/
public function toString() {
return $this->getClassName().'<'.$this->marker.'>'.\xp::stringOf($this->data);
return nameof($this).'<'.$this->marker.'>'.\xp::stringOf($this->data);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/io/SOFNSegment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function channels() {
* @return string
*/
public function toString() {
return $this->getClassName().'<'.$this->marker.'>'.\xp::stringOf($this->data);
return nameof($this).'<'.$this->marker.'>'.\xp::stringOf($this->data);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/io/Segment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct($marker, $bytes) {
* @return string
*/
public function toString() {
return $this->getClassName().'<'.$this->marker.'>('.strlen($this->bytes).' bytes)';
return nameof($this).'<'.$this->marker.'>('.strlen($this->bytes).' bytes)';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/io/XMPSegment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function document() {
* @return string
*/
public function toString() {
return $this->getClassName().'<'.$this->marker.'>'.\xp::stringOf($this->document);
return nameof($this).'<'.$this->marker.'>'.\xp::stringOf($this->document);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/util/ExifData.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ public function toString() {
" [isoSpeedRatings ] %s\n".
" [focalLength ] %s\n".
"}",
$this->getClassName(),
nameof($this),
$this->width,
$this->height,
$this->mimeType,
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/img/util/ImageInfo.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function toString() {
" [bits ] %s\n".
" [segments ] %s\n".
"}",
$this->getClassName(),
nameof($this),
$this->width,
$this->height,
$this->mime,
Expand Down

0 comments on commit a969a67

Please sign in to comment.