22 if (is_string($value)) {
24 } elseif (is_object($value)) {
27 $value = $value->format(
'Y-m-d H:i:s');
28 } elseif (!($value instanceof
RichText)) {
29 $value = (string) $value;
50 if ($value === null) {
52 } elseif (is_float($value) || is_int($value)) {
54 } elseif (is_bool($value)) {
56 } elseif ($value ===
'') {
58 } elseif ($value instanceof
RichText) {
60 } elseif (is_string($value) && $value[0] ===
'=' && strlen($value) > 1) {
62 } elseif (preg_match(
'/^[\+\-]?(\d+\\.?\d*|\d*\\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $value)) {
63 $tValue = ltrim($value,
'+-');
64 if (is_string($value) && $tValue[0] ===
'0' && strlen($tValue) > 1 && $tValue[1] !==
'.') {
66 } elseif ((strpos($value,
'.') ===
false) && ($value > PHP_INT_MAX)) {
68 } elseif (!is_numeric($value)) {
73 } elseif (is_string($value)) {
75 if (isset($errorCodes[$value])) {
setValueExplicit($pValue, $pDataType)
Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the ...
static sanitizeUTF8($value)
Try to sanitize UTF8, stripping invalid byte sequences.
static static getErrorCodes()
Get list of error codes.
bindValue(Cell $cell, $value)
Bind value to a cell.
static dataTypeForValue($value)
DataType for value.