Converts the default string for set columns to an array.

@param string $stringValue

@return array|null
967992
protected function getDefaultValueForSet($stringValue)
    {
        $stringValue = trim($stringValue);

        if (empty($stringValue)) {
            return null;
        }

        $values = [];
        foreach (explode(',', $stringValue) as $v) {
            $values[] = trim($v);
        }
        if (count($values) === 0) {
            return null;
        }
        return $values;
    }
692477
protected function extractDefault($defaultValue)
	{
		if($this->dbType==='timestamp' )
			$this->defaultValue=null;
		else
			parent::extractDefault(str_replace(array('(',')',"'"), '', $defaultValue));
	}
841021
public static function TRIMSPACES($stringValue = '') {
		$stringValue	= PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);

		if (is_bool($stringValue)) {
			return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
		}

		if (is_string($stringValue) || is_numeric($stringValue)) {
			return trim(preg_replace('/ +/',' ',trim($stringValue,' ')));
		}
		return NULL;
	}
1210236
public static function RETURNSTRING($testValue = '') {
		$testValue	= PHPExcel_Calculation_Functions::flattenSingleValue($testValue);

		if (is_string($testValue)) {
			return $testValue;
		}
		return Null;
	}
1113235
public function getQueryArgs($formValue)
    {
        // TODO: Implement getQueryArgs() method.
        $arr = [];
        if (is_array($formValue) && !empty($formValue)) {
            $arr = $formValue;
        }

        if (is_string($formValue) && !empty($formValue)) {
            $arr = array_filter(explode(',', $formValue));
        }

        return [$this->field, $arr];
    }
50898
public function getValue($nullValue = null, $calculateFormulas = false, $formatData = true)
    {
        $value = $nullValue;
        if ($this->cell->getValue() !== null) {
            if ($this->cell->getValue() instanceof RichText) {
                $value = $this->cell->getValue()->getPlainText();
            } elseif ($calculateFormulas) {
                $value = $this->cell->getCalculatedValue();
            } else {
                $value = $this->cell->getValue();
            }

            if ($formatData) {
                $style = $this->cell->getWorksheet()->getParent()->getCellXfByIndex($this->cell->getXfIndex());
                $value = NumberFormat::toFormattedString(
                    $value,
                    ($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : NumberFormat::FORMAT_GENERAL
                );
            }
        }

        return $value;
    }
937848
protected function processPropertyValue($propertyValue)
    {
        // If this is an item value
        if (is_object($propertyValue) && isset($propertyValue->type)) {
            return $this->__invoke($propertyValue);

            // Else these are alternate values
        } elseif (is_array($propertyValue)) {
            return new AlternateValues(array_map([$this, __METHOD__], $propertyValue));
        }

        list($propertyValue, $language) = $this->processLanguageTaggedPropertyValue($propertyValue);

        return new StringValue($propertyValue, $language);
    }
845514
protected function getProperty(string $propertyName, $defaultValue)
    {
        if (count($this->values) === 1 && isset($this->values['__value'])) {
            return $this->parseType($this->values['__value']);
        }

        if (isset($this->values[$propertyName])) {
            return $this->parseType($this->values[$propertyName]);
        }

        return $defaultValue;
    }
318026
public function extractDefault(ColumnSchema $field, $defaultValue)
    {
        if ($field->dbType === 'timestamp' && $defaultValue === 'CURRENT_TIMESTAMP') {
            $defaultValue = null;
        } else {
            $defaultValue = strcasecmp($defaultValue, 'null') ? $defaultValue : null;
        }

        if (is_string($defaultValue)) // PHP 5.2.6 adds single quotes while 5.2.0 doesn't
        {
            $defaultValue = trim($defaultValue, "'\"");
        }

        parent::extractDefault($field, $defaultValue);
    }
500238
public function deserialize($serializedValue)
    {
        if (null === $serializedValue && $this->isNullable()) {
            return ($this->default === null) ? null : $this->default;
        }

        if (!is_string($serializedValue)) {
            throw InvalidArgumentException::expected('string', $serializedValue);
        }

        return new \DateTimeImmutable($serializedValue);
    }
924363
public static String[] toStringArray(Array array, String defaultValue) {
	String[] arr = new String[array.size()];
	for (int i = 0; i < arr.length; i++) {
	    arr[i] = Caster.toString(array.get(i + 1, defaultValue), defaultValue);
	}

	return arr;
    }
1369785
protected function extractDefault($defaultValue)
	{
		if(strncmp($this->dbType,'bit',3)===0)
			$this->defaultValue=bindec(trim($defaultValue,'b\''));
		elseif(($this->dbType==='timestamp' || $this->dbType==='datetime')  && ($defaultValue==='CURRENT_TIMESTAMP' || $defaultValue==='current_timestamp()'))
			$this->defaultValue=null;
		else
			parent::extractDefault($defaultValue);
	}
172765
protected function getParam($param = null, $defaultValue = null)
    {
        $request = $this->getRequest();
        if ($param === null) {
            return array_merge($request->getQuery(), $request->getParams());
        }

        $value = $request->getParam($param);
        if ($value === null) {
            return $request->getQuery($param, $defaultValue);
        }

        return $value;
    }
1083296
public function getHeader(string $header, string $defaultValue = null)
    {
        $header = strtolower($header);
        if (isset($this->headers[$header])) {
            return $this->headers[$header];
        }
        return $defaultValue;
    }
308233
public static function getLines(string $filename, array $defaultValue = []): array
    {
        $content = self::get($filename);
        $content = str_replace("\r", '', $content);
        if (trim($content) !== '') {
            return explode("\n", $content);
        }
        return $defaultValue;
    }
675876
protected function getDefaultValueString(Column $column)
    {
        $defaultValue = var_export(null, true);
        $val = $column->getPhpDefaultValue();
        if (null === $val) {
            return $defaultValue;
        }

        if ($column->isTemporalType()) {
            $fmt = $this->getTemporalFormatter($column);
            try {
                if (!($this->getPlatform() instanceof MysqlPlatform &&
                    ($val === '0000-00-00 00:00:00' || $val === '0000-00-00'))) {
                    // while technically this is not a default value of NULL,
                    // this seems to be closest in meaning.
                    $defDt = new \DateTime($val);
                    $defaultValue = var_export($defDt->format($fmt), true);
                }
            } catch (\Exception $exception) {
                // prevent endless loop when timezone is undefined
                date_default_timezone_set('America/Los_Angeles');
                throw new EngineException(sprintf('Unable to parse default temporal value "%s" for column "%s"', $column->getDefaultValueString(), $column->getFullyQualifiedName()), 0, $exception);
            }
        } elseif ($column->isEnumType()) {
            $valueSet = $column->getValueSet();
            if (!in_array($val, $valueSet)) {
                throw new EngineException(sprintf('Default Value "%s" is not among the enumerated values', $val));
            }
            $defaultValue = array_search($val, $valueSet);
        } elseif ($column->isSetType()) {
            $defaultValue = SetColumnConverter::convertToInt($val, $column->getValueSet());
        } elseif ($column->isPhpPrimitiveType()) {
            settype($val, $column->getPhpType());
            $defaultValue = var_export($val, true);
        } elseif ($column->isPhpObjectType()) {
            $defaultValue = 'new '.$column->getPhpType().'(' . var_export($val, true) . ')';
        } elseif ($column->isPhpArrayType()) {
            $defaultValue = var_export($val, true);
        } else {
            throw new EngineException("Cannot get default value string for " . $column->getFullyQualifiedName());
        }

        return $defaultValue;
    }
129333
public function toArray($nullValue = null, $calculateFormulas = false, $formatData = true)
    {
        $cells = [];

        $i = 0;
        foreach ($this->row->getCellIterator() as $cell) {
            $value = (new Cell($cell))->getValue($nullValue, $calculateFormulas, $formatData);

            if (isset($this->headingRow[$i])) {
                $cells[$this->headingRow[$i]] = $value;
            } else {
                $cells[] = $value;
            }

            $i++;
        }

        return $cells;
    }