Skip to content

Commit 70f10df

Browse files
committed
Replace xp::stringOf() with util.Objects::stringOf()
1 parent 5551b38 commit 70f10df

11 files changed

+31
-17
lines changed

src/main/php/rdbms/Criteria.class.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php namespace rdbms;
22

3-
use rdbms\criterion\SimpleExpression;
4-
use rdbms\criterion\Projections;
5-
use rdbms\criterion\ProjectionList;
63
use rdbms\criterion\Criterion;
4+
use rdbms\criterion\ProjectionList;
5+
use rdbms\criterion\Projections;
6+
use rdbms\criterion\SimpleExpression;
7+
use util\Objects;
78

89
define('ASCENDING', 'asc');
910
define('DESCENDING', 'desc');
@@ -169,7 +170,7 @@ public function setFetchmode(\rdbms\join\Fetchmode $fetchmode) {
169170
public function toString() {
170171
$s= nameof($this)."@{\n";
171172
foreach ($this->conditions as $condition) {
172-
$s.= ' '.\xp::stringOf($condition)."\n";
173+
$s.= ' '.Objects::stringOf($condition)."\n";
173174
}
174175
return $s.'}';
175176
}

src/main/php/rdbms/DBEvent.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php namespace rdbms;
22

3+
use util\Objects;
4+
35
/**
46
* Generic DB event.
57
*
@@ -68,6 +70,6 @@ public function getArgument() {
6870
* @return string
6971
*/
7072
public function toString() {
71-
return nameof($this).'('.$this->name.') {'.\xp::stringOf($this->arg).'}';
73+
return nameof($this).'('.$this->name.') {'.Objects::stringOf($this->arg).'}';
7274
}
7375
}

src/main/php/rdbms/DataSet.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php namespace rdbms;
22

3-
use rdbms\join\JoinExtractable;
43
use lang\Value;
4+
use rdbms\join\JoinExtractable;
55
use util\Objects;
66

77
/**
@@ -255,7 +255,7 @@ public function toString() {
255255
$key,
256256
(in_array($key, $peer->primary) ? 'PK' : ''),
257257
($key == $peer->identity ? ',I' : ''),
258-
\xp::stringOf($this->$key)
258+
Objects::stringOf($this->$key)
259259
)."\n";
260260
}
261261
return $s.'}';

src/main/php/rdbms/DriverManager.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php namespace rdbms;
22

3+
use util\Objects;
4+
35
/**
46
* Manages database drivers
57
*
@@ -155,7 +157,7 @@ public static function getConnection($dsn) {
155157
throw new DriverNotSupportedException(sprintf(
156158
'No driver registered for "%s" or provided by any of %s',
157159
$driver,
158-
\xp::stringOf($provider)
160+
Objects::stringOf($provider)
159161
));
160162
} while (0);
161163
}

src/main/php/rdbms/ResultSet.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php namespace rdbms;
22

3-
use util\TimeZone;
43
use lang\Closeable;
4+
use util\Objects;
5+
use util\TimeZone;
56

67
/**
78
* Result set as returned from the DBConnection::query method
@@ -84,7 +85,7 @@ public function getIterator() {
8485
* @return string
8586
*/
8687
public function toString() {
87-
return nameof($this).'('.\xp::stringOf($this->handle).')@'.\xp::stringOf($this->fields);
88+
return nameof($this).'('.Objects::stringOf($this->handle).')@'.Objects::stringOf($this->fields);
8889
}
8990

9091
/**

src/main/php/rdbms/SQLFunction.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php namespace rdbms;
22

3+
use util\Objects;
4+
35
/**
46
* Represents an SQL standard procedure
57
*/
@@ -84,6 +86,6 @@ public function getType() {
8486
* @return string
8587
*/
8688
public function toString() {
87-
return nameof($this).'<'.$this->type.' '.$this->func.' ('.\xp::stringOf($this->args).')>';
89+
return nameof($this).'<'.$this->type.' '.$this->func.' ('.Objects::stringOf($this->args).')>';
8890
}
8991
}

src/main/php/rdbms/criterion/SimpleExpression.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use rdbms\DBConnection;
44
use rdbms\Peer;
55
use rdbms\SQLFragment;
6+
use util\Objects;
67

78
/**
89
* Simple expression
@@ -77,9 +78,9 @@ public function toString() {
7778
return sprintf(
7879
'%s({%s %s} %% %s)',
7980
nameof($this),
80-
\xp::stringOf($this->lhs),
81+
Objects::stringOf($this->lhs),
8182
$this->op,
82-
\xp::stringOf($this->value)
83+
Objects::stringOf($this->value)
8384
);
8485
}
8586

src/main/php/rdbms/mysqlx/MySqlxProtocol.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use peer\ProtocolException;
44
use peer\Socket;
55
use util\Date;
6+
use util\Objects;
67

78
/**
89
* MySQL protocol implementation
@@ -488,6 +489,6 @@ public function hashCode() {
488489
* @return string
489490
*/
490491
public function toString() {
491-
return nameof($this).'(stream= '.\xp::stringOf($this->sock).', thread= '.$this->thread.', packet= '.$this->pkt.')';
492+
return nameof($this).'(stream= '.Objects::stringOf($this->sock).', thread= '.$this->thread.', packet= '.$this->pkt.')';
492493
}
493494
}

src/main/php/rdbms/tds/TdsProtocol.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use peer\ProtocolException;
44
use peer\Socket;
5+
use util\Objects;
56

67
/**
78
* TDS protocol implementation
@@ -673,6 +674,6 @@ public function close() {
673674
* @return string
674675
*/
675676
public function toString() {
676-
return nameof($this).'('.\xp::stringOf($this->stream).')';
677+
return nameof($this).'('.Objects::stringOf($this->stream).')';
677678
}
678679
}

src/main/php/rdbms/util/DBConstraintXmlGenerator.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
use lang\System;
44
use rdbms\DBTable;
5+
use util\Objects;
56
use util\log\Traceable;
67
use xml\Tree;
78

9+
810
/**
911
* Generate the relation map of a database
1012
*
@@ -61,7 +63,7 @@ public function getTree() {
6163

6264
if ($constraint= $t->getFirstForeignKeyConstraint()) do {
6365
if (isset($constKeyList[$this->constraintKey($constraint)])) {
64-
$this->cat && $this->cat->warn($t->name, 'has a double constraint'."\n".\xp::stringOf($constraint));
66+
$this->cat && $this->cat->warn($t->name, 'has a double constraint'."\n".Objects::stringOf($constraint));
6567
continue;
6668
}
6769
$constKeyList[$this->constraintKey($constraint)]= true;

0 commit comments

Comments
 (0)