@@ -64,7 +64,7 @@ public function getTableMetaData()
64
64
*/
65
65
public function getRowCount ()
66
66
{
67
- return count ($ this ->data );
67
+ return \ count ($ this ->data );
68
68
}
69
69
70
70
/**
@@ -82,7 +82,7 @@ public function getValue($row, $column)
82
82
83
83
return ($ value instanceof SimpleXMLElement) ? (string ) $ value : $ value ;
84
84
} else {
85
- if (!in_array ($ column , $ this ->getTableMetaData ()->getColumns ()) || $ this ->getRowCount () <= $ row ) {
85
+ if (!\ in_array ($ column , $ this ->getTableMetaData ()->getColumns ()) || $ this ->getRowCount () <= $ row ) {
86
86
throw new InvalidArgumentException ("The given row ( {$ row }) and column ( {$ column }) do not exist in table {$ this ->getTableMetaData ()->getTableName ()}" );
87
87
} else {
88
88
return ;
@@ -117,7 +117,7 @@ public function getRow($row)
117
117
*/
118
118
public function matches (ITable $ other )
119
119
{
120
- $ thisMetaData = $ this ->getTableMetaData ();
120
+ $ thisMetaData = $ this ->getTableMetaData ();
121
121
$ otherMetaData = $ other ->getTableMetaData ();
122
122
123
123
if (!$ thisMetaData ->matches ($ otherMetaData ) ||
@@ -126,14 +126,14 @@ public function matches(ITable $other)
126
126
return false ;
127
127
}
128
128
129
- $ columns = $ thisMetaData ->getColumns ();
129
+ $ columns = $ thisMetaData ->getColumns ();
130
130
$ rowCount = $ this ->getRowCount ();
131
131
132
132
for ($ i = 0 ; $ i < $ rowCount ; $ i ++) {
133
133
foreach ($ columns as $ columnName ) {
134
- $ thisValue = $ this ->getValue ($ i , $ columnName );
134
+ $ thisValue = $ this ->getValue ($ i , $ columnName );
135
135
$ otherValue = $ other ->getValue ($ i , $ columnName );
136
- if (is_numeric ($ thisValue ) && is_numeric ($ otherValue )) {
136
+ if (\ is_numeric ($ thisValue ) && \ is_numeric ($ otherValue )) {
137
137
if ($ thisValue != $ otherValue ) {
138
138
$ this ->other = $ other ;
139
139
@@ -159,21 +159,21 @@ public function matches(ITable $other)
159
159
*/
160
160
public function assertContainsRow (array $ row )
161
161
{
162
- return in_array ($ row , $ this ->data );
162
+ return \ in_array ($ row , $ this ->data );
163
163
}
164
164
165
165
public function __toString ()
166
166
{
167
167
$ columns = $ this ->getTableMetaData ()->getColumns ();
168
- $ count = count ($ columns );
168
+ $ count = \ count ($ columns );
169
169
// if count less than 0 (when table is empty), then set count to one
170
- $ count = $ count >= 1 ? $ count : 1 ;
171
- $ lineSeperator = str_repeat ('+---------------------- ' , $ count ) . "+ \n" ;
172
- $ lineLength = strlen ($ lineSeperator ) - 1 ;
170
+ $ count = $ count >= 1 ? $ count : 1 ;
171
+ $ lineSeperator = \ str_repeat ('+---------------------- ' , $ count ) . "+ \n" ;
172
+ $ lineLength = \ strlen ($ lineSeperator ) - 1 ;
173
173
174
174
$ tableString = $ lineSeperator ;
175
- $ tblName = $ this ->getTableMetaData ()->getTableName ();
176
- $ tableString .= '| ' . str_pad ($ tblName , $ lineLength - 4 , ' ' ,
175
+ $ tblName = $ this ->getTableMetaData ()->getTableName ();
176
+ $ tableString .= '| ' . \ str_pad ($ tblName , $ lineLength - 4 , ' ' ,
177
177
STR_PAD_RIGHT ) . " | \n" ;
178
178
$ tableString .= $ lineSeperator ;
179
179
$ rows = $ this ->rowToString ($ columns );
@@ -188,10 +188,10 @@ public function __toString()
188
188
if ($ this ->other ) {
189
189
try {
190
190
if ($ this ->getValue ($ i , $ columnName ) != $ this ->other ->getValue ($ i , $ columnName )) {
191
- $ values [] = sprintf (
191
+ $ values [] = \ sprintf (
192
192
'%s != actual %s ' ,
193
- var_export ($ this ->getValue ($ i , $ columnName ), true ),
194
- var_export ($ this ->other ->getValue ($ i , $ columnName ), true )
193
+ \ var_export ($ this ->getValue ($ i , $ columnName ), true ),
194
+ \ var_export ($ this ->other ->getValue ($ i , $ columnName ), true )
195
195
);
196
196
} else {
197
197
$ values [] = $ this ->getValue ($ i , $ columnName );
@@ -215,14 +215,14 @@ protected function rowToString(array $row)
215
215
$ rowString = '' ;
216
216
217
217
foreach ($ row as $ value ) {
218
- if (is_null ($ value )) {
218
+ if (\ is_null ($ value )) {
219
219
$ value = 'NULL ' ;
220
220
}
221
221
222
- $ value_str = mb_substr ($ value , 0 , 20 );
222
+ $ value_str = \ mb_substr ($ value , 0 , 20 );
223
223
// make str_pad act in multibyte manner
224
- $ correction = strlen ($ value_str ) - mb_strlen ($ value_str );
225
- $ rowString .= '| ' . str_pad ($ value_str , 20 + $ correction , ' ' , STR_PAD_BOTH ) . ' ' ;
224
+ $ correction = \ strlen ($ value_str ) - \ mb_strlen ($ value_str );
225
+ $ rowString .= '| ' . \ str_pad ($ value_str , 20 + $ correction , ' ' , STR_PAD_BOTH ) . ' ' ;
226
226
}
227
227
/** @see https://github.com/sebastianbergmann/dbunit/issues/195 */
228
228
$ rowString = !empty ($ row ) ? $ rowString . "| \n" : '' ;
0 commit comments