Skip to content

Commit 3f592d8

Browse files
committed
QA: Implement lang.Value
1 parent 19e2124 commit 3f592d8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/test/php/lang/ast/unittest/emit/Handle.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php namespace lang\ast\unittest\emit;
22

3-
use lang\IllegalArgumentException;
3+
use lang\{IllegalArgumentException, Value};
44

55
/** Used by `UsingTest` */
6-
class Handle implements \IDisposable {
6+
class Handle implements Value, \IDisposable {
77
public static $DEFAULT;
88
public static $called= [];
99
private $id;
@@ -28,6 +28,12 @@ public function read($bytes= 8192) {
2828
return 'test';
2929
}
3030

31+
public function toString() { return nameof($this).'<'.$this->id.'>'; }
32+
33+
public function hashCode() { return '#'.$this->id; }
34+
35+
public function compareTo($value) { return $value instanceof self ? $value->id <=> $this->id : 1; }
36+
3137
public function __dispose() {
3238
self::$called[]= '__dispose@'.$this->id;
3339
}

0 commit comments

Comments
 (0)