@@ -146,7 +146,7 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
146
146
switch ($ srctype ) {
147
147
case PropertyType::DATE :
148
148
if (! $ value instanceof \DateTime) {
149
- throw new RepositoryException ('Can not convert a date that is not a \DateTime instance to string ' );
149
+ throw new RepositoryException ('Cannot convert a date that is not a \DateTime instance to string ' );
150
150
}
151
151
/** @var $value \DateTime */
152
152
// Milliseconds formatting is not possible in PHP so we
@@ -161,7 +161,7 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
161
161
return $ value ;
162
162
default :
163
163
if (is_object ($ value )) {
164
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to STRING ' );
164
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to STRING ' );
165
165
}
166
166
if (is_resource ($ value )) {
167
167
throw new ValueFormatException ('Inconsistency: Non-binary property should not have resource stream value ' );
@@ -200,9 +200,9 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
200
200
return $ value ->getTimestamp ();
201
201
}
202
202
if (is_object ($ value )) {
203
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a LONG ' );
203
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a LONG ' );
204
204
}
205
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to a LONG ' );
205
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to a LONG ' );
206
206
207
207
case PropertyType::DOUBLE :
208
208
switch ($ srctype ) {
@@ -222,9 +222,9 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
222
222
return (double ) $ value ->getTimestamp ();
223
223
}
224
224
if (is_object ($ value )) {
225
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a DOUBLE ' );
225
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a DOUBLE ' );
226
226
}
227
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to a DOUBLE ' );
227
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to a DOUBLE ' );
228
228
229
229
case PropertyType::DATE :
230
230
switch ($ srctype ) {
@@ -247,9 +247,9 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
247
247
return $ datetime ;
248
248
}
249
249
if (is_object ($ value )) {
250
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a DATE ' );
250
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a DATE ' );
251
251
}
252
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to DATE ' );
252
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to DATE ' );
253
253
254
254
case PropertyType::BOOLEAN :
255
255
switch ($ srctype ) {
@@ -266,9 +266,9 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
266
266
return (boolean ) ((double ) $ value ); // '0' is false too
267
267
}
268
268
if (is_object ($ value )) {
269
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a BOOLEAN ' );
269
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a BOOLEAN ' );
270
270
}
271
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to a BOOLEAN ' );
271
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to a BOOLEAN ' );
272
272
273
273
case PropertyType::NAME :
274
274
switch ($ srctype ) {
@@ -282,9 +282,9 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
282
282
return $ value ;
283
283
}
284
284
if (is_object ($ value )) {
285
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a NAME ' );
285
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a NAME ' );
286
286
}
287
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to NAME ' );
287
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to NAME ' );
288
288
289
289
case PropertyType::PATH :
290
290
switch ($ srctype ) {
@@ -299,9 +299,9 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
299
299
return $ value ;
300
300
}
301
301
if (is_object ($ value )) {
302
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a PATH ' );
302
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a PATH ' );
303
303
}
304
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to PATH ' );
304
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to PATH ' );
305
305
306
306
case PropertyType::REFERENCE :
307
307
case PropertyType::WEAKREFERENCE :
@@ -311,15 +311,15 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
311
311
case PropertyType::WEAKREFERENCE :
312
312
if (empty ($ value )) {
313
313
//TODO check if string is valid uuid
314
- throw new ValueFormatException ('Value ' .var_export ($ value , true ).' is not a valid unique id ' );
314
+ throw new ValueFormatException ('Value " ' .var_export ($ value , true ).'" is not a valid unique id ' );
315
315
}
316
316
317
317
return $ value ;
318
318
}
319
319
if (is_object ($ value )) {
320
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a unique id ' );
320
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a unique id ' );
321
321
}
322
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to unique id ' );
322
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to unique id ' );
323
323
324
324
case PropertyType::URI :
325
325
switch ($ srctype ) {
@@ -341,9 +341,9 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
341
341
return $ value ;
342
342
}
343
343
if (is_object ($ value )) {
344
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a URI ' );
344
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a URI ' );
345
345
}
346
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to URI ' );
346
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to URI ' );
347
347
348
348
case PropertyType::DECIMAL :
349
349
switch ($ srctype ) {
@@ -361,12 +361,12 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
361
361
return (string ) $ value ->getTimestamp ();
362
362
}
363
363
if (is_object ($ value )) {
364
- throw new ValueFormatException ('Can not convert object of class ' .get_class ($ value ).' to a DECIMAL ' );
364
+ throw new ValueFormatException ('Cannot convert object of class " ' .get_class ($ value ).'" to a DECIMAL ' );
365
365
}
366
- throw new ValueFormatException ('Can not convert ' .var_export ($ value , true ).' to a DECIMAL ' );
366
+ throw new ValueFormatException ('Cannot convert " ' .var_export ($ value , true ).'" to a DECIMAL ' );
367
367
368
368
default :
369
- throw new ValueFormatException (" Unexpected target type $ type in conversion " );
369
+ throw new ValueFormatException (' Unexpected target type " ' . $ type . ' " in conversion' );
370
370
}
371
371
}
372
372
}
0 commit comments