diff --git a/ChangeLog.md b/ChangeLog.md index fc868831..3a7d3002 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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 diff --git a/src/main/php/img/Color.class.php b/src/main/php/img/Color.class.php index 95c8859f..cc6b7d1d 100644 --- a/src/main/php/img/Color.class.php +++ b/src/main/php/img/Color.class.php @@ -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 diff --git a/src/main/php/img/Image.class.php b/src/main/php/img/Image.class.php index 9d7b1e1c..f1aad9fa 100644 --- a/src/main/php/img/Image.class.php +++ b/src/main/php/img/Image.class.php @@ -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) diff --git a/src/main/php/img/io/CommentSegment.class.php b/src/main/php/img/io/CommentSegment.class.php index 87400447..f1aa02c7 100755 --- a/src/main/php/img/io/CommentSegment.class.php +++ b/src/main/php/img/io/CommentSegment.class.php @@ -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); } /** diff --git a/src/main/php/img/io/ExifSegment.class.php b/src/main/php/img/io/ExifSegment.class.php index bc957bea..90874c1d 100755 --- a/src/main/php/img/io/ExifSegment.class.php +++ b/src/main/php/img/io/ExifSegment.class.php @@ -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); } /** diff --git a/src/main/php/img/io/ImageMetaData.class.php b/src/main/php/img/io/ImageMetaData.class.php index 9a58d505..69346a39 100755 --- a/src/main/php/img/io/ImageMetaData.class.php +++ b/src/main/php/img/io/ImageMetaData.class.php @@ -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; } diff --git a/src/main/php/img/io/IptcSegment.class.php b/src/main/php/img/io/IptcSegment.class.php index 2b4949e6..dbd81c99 100755 --- a/src/main/php/img/io/IptcSegment.class.php +++ b/src/main/php/img/io/IptcSegment.class.php @@ -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); } /** diff --git a/src/main/php/img/io/SOFNSegment.class.php b/src/main/php/img/io/SOFNSegment.class.php index 44a2aa6b..7c76915d 100755 --- a/src/main/php/img/io/SOFNSegment.class.php +++ b/src/main/php/img/io/SOFNSegment.class.php @@ -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); } /** diff --git a/src/main/php/img/io/Segment.class.php b/src/main/php/img/io/Segment.class.php index f5488d53..e20308cb 100755 --- a/src/main/php/img/io/Segment.class.php +++ b/src/main/php/img/io/Segment.class.php @@ -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)'; } /** diff --git a/src/main/php/img/io/XMPSegment.class.php b/src/main/php/img/io/XMPSegment.class.php index 69d88166..f575aa25 100755 --- a/src/main/php/img/io/XMPSegment.class.php +++ b/src/main/php/img/io/XMPSegment.class.php @@ -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); } /** diff --git a/src/main/php/img/util/ExifData.class.php b/src/main/php/img/util/ExifData.class.php index 40d63e52..2e6de11c 100644 --- a/src/main/php/img/util/ExifData.class.php +++ b/src/main/php/img/util/ExifData.class.php @@ -863,7 +863,7 @@ public function toString() { " [isoSpeedRatings ] %s\n". " [focalLength ] %s\n". "}", - $this->getClassName(), + nameof($this), $this->width, $this->height, $this->mimeType, diff --git a/src/main/php/img/util/ImageInfo.class.php b/src/main/php/img/util/ImageInfo.class.php index 0cce1ab2..7afd8b44 100644 --- a/src/main/php/img/util/ImageInfo.class.php +++ b/src/main/php/img/util/ImageInfo.class.php @@ -58,7 +58,7 @@ public function toString() { " [bits ] %s\n". " [segments ] %s\n". "}", - $this->getClassName(), + nameof($this), $this->width, $this->height, $this->mime,