Formats data for gs1-128.

@return string
510983
private function formatGs1128() {
        $formatedText = '~F1';
        $formatedLabel = '';
        $c = count($this->identifiersId);

        for ($i = 0; $i < $c; $i++) {
            if ($i > 0) {
                $formatedLabel .= ' ';
            }

            if ($this->identifiersId[$i] !== null) {
                $formatedLabel .= '(' . $this->identifiersId[$i] . ')';
            }

            $formatedText .= $this->identifiersId[$i];

            $formatedLabel .= $this->identifiersContent[$i];
            $formatedText .= $this->identifiersContent[$i];

            if (isset($this->identifiersAi[$this->identifiersId[$i]])) {
                $ai_data = $this->identifiersAi[$this->identifiersId[$i]];
            } elseif (isset($this->identifiersId[$i][3])) {
                $identifierWithVar = substr($this->identifiersId[$i], 0, -1) . 'y';
                $ai_data = isset($this->identifiersAi[$identifierWithVar]) ? $this->identifiersAi[$identifierWithVar] : null;
            } else {
                $ai_data = null;
            }

            /* We'll check if we need to add a ~F1 (<GS>) char */
            /* If we use the legacy mode, we always add a ~F1 (<GS>) char between AIs */
            if ($ai_data !== null) {
                if ((strlen($this->identifiersContent[$i]) < $ai_data[self::MAXLENGTH] && ($i + 1) !== $c) || (!$this->strictMode && ($i + 1) !== $c)) {
                    $formatedText .= '~F1';
                }
            } elseif ($this->allowsUnknownIdentifier && $this->identifiersId[$i] === null && ($i + 1) !== $c) {
                /* If this id is unknown, we add a ~F1 (<GS>) char */
                $formatedText .= '~F1';
            }
        }

        if ($this->noLengthLimit === false && (strlen(str_replace('~F1', chr(29), $formatedText)) - 1) > self::MAX_GS1128_CHARS) {
            throw new CINParseException('gs1128', 'The barcode can\'t contain more than ' . self::MAX_GS1128_CHARS . ' characters.');
        }

        $this->label = $formatedLabel;
        return $formatedText;
    }
1187252
public function toString()
    {
        return implode(', ', array_filter([
            $this->name,
            $this->street1,
            $this->street2,
            $this->city,
            $this->county,
            $this->postcode,
            $this->country($this->country)->name,
        ]));
    }
1324090
public function toString()
    {
        if (!empty($this->alias)) {
            return $this->alias;
        }

        $version = '';

        if (!empty($this->nickname)) {
            $version .= $this->nickname . ' ';
        }

        if (!empty($this->value)) {
            if (preg_match("/([0-9]+)(?:\.([0-9]+))?(?:\.([0-9]+))?(?:\.([0-9]+))?(?:([ab])([0-9]+))?/", $this->value, $match)) {
                $v = [ $match[1] ];

                if (array_key_exists(2, $match) && strlen($match[2])) {
                    $v[] = $match[2];
                }

                if (array_key_exists(3, $match) && strlen($match[3])) {
                    $v[] = $match[3];
                }

                if (array_key_exists(4, $match) && strlen($match[4])) {
                    $v[] = $match[4];
                }

                if (!empty($this->details)) {
                    if ($this->details < 0) {
                        array_splice($v, $this->details, 0 - $this->details);
                    }

                    if ($this->details > 0) {
                        array_splice($v, $this->details, count($v) - $this->details);
                    }
                }

                if (isset($this->builds) && !$this->builds) {
                    $count = count($v);
                    for ($i = 0; $i < $count; $i++) {
                        if ($v[$i] > 999) {
                            array_splice($v, $i, 1);
                        }
                    }
                }

                $version .= implode($v, '.');

                if (array_key_exists(5, $match) && strlen($match[5])) {
                    $version .= $match[5] . (!empty($match[6]) ? $match[6] : '');
                }
            }
        }

        return $version;
    }
1346766
public function toString() {
		$txt = $this->getName ();
		$txt .= $this->getPesel ();
		$txt .= "id:";
		$txt .= $this->getId ();
		$txt .= "oid:";
		$txt .= $this->getOddzialId ();
		$txt .= "d:";
		$data = $this->getDataKategoryzacji ();
		if ($data instanceof \DateTime) {
			$txt .= $this->getDataKategoryzacji ()->format ( "Y-m-d" );
		} else {
			$txt .= $this->getDataKategoryzacji ();
		}
		return $txt;
	}
1001023
public function getDsn(): string
  {
    // pgsql:host=<hostname>;port=26257;dbname=bank;sslmode=disable

    # Build the DSN
    $_dsn = $this->getDriver().':' . 
            'host=' . $this->GetHost().';' . 
            'port=' . ($this->GetPort()!=0 ? $this->GetPort() . ':' : '26257' ) .
            'dbname=' . $this->GetSchema().';' .
            'sslmode=' . $this->getSSLMode();
            // 'charset='.$this->GetCharset();
    # Set it
    $this->setDsn($_dsn);
    # Results
    return $this->pdo_dsn;
  }
786906
protected function formatData($data=null)
    {
        if (!is_null($data)) {
            if (is_scalar($data)) {
                $data = ['id' => $data];
            }
        } else {
            $data = (array) $data;
        }
        
        foreach ($data as $k => $v) {
            if ($v == "" || is_bool($v)) {
                $data[$k] = intval($v);
            } elseif (is_numeric($v)) {
                $data[$k] = (strpos($v, '.') !== false) ? floatval($v) : intval($v);
            }
        }
        
        $data && ksort($data);
        
        return $data;
    }
147210
public function toIso8601String()
    {
        $parts = [];

        if ($this->recurrences !== null) {
            $parts[] = 'R'.$this->recurrences;
        }

        $parts[] = $this->startDate->toIso8601String();

        $parts[] = $this->dateInterval->spec();

        if ($this->endDate !== null) {
            $parts[] = $this->endDate->toIso8601String();
        }

        return implode('/', $parts);
    }
877979
public function toSixFigureString()
	{
		$hundredkmE = floor($this->easting / 100000);
		$hundredkmN = floor($this->northing / 100000);

		if ($hundredkmN < 5) {
			$firstLetter = ($hundredkmE < 5) ? 'S' : 'T';
		} else if ($hundredkmN < 10) {
			$firstLetter = ($hundredkmE < 5) ? 'N' : 'O';
		} else {
			$firstLetter = 'H';
		}

		$index = 65 + ((4 - ($hundredkmN % 5)) * 5) + ($hundredkmE % 5);
		$ti = $index;
		if ($index >= 73) {
			$index++;
		}

		$secondLetter = chr($index);

		$e = round(($this->easting - (100000 * $hundredkmE)) / 100);
		$n = round(($this->northing - (100000 * $hundredkmN)) / 100);

		return sprintf('%s%s%03d%03d', $firstLetter, $secondLetter, $e, $n);
	}
1111391
public function to_bin()
   {
         $out = "";
      for ($i=0; $i<$this->dataLength($this->data); $i++)
         $out = sprintf("%08b",$this->data[$i]).$out;
      return $out;      
   }
1355669
protected function _generateBasedOnOpenSSL()
    {
        $sRandomData = openssl_random_pseudo_bytes(16);
        $sRandomData[6] = chr(ord($sRandomData[6]) & 0x0f | 0x40); // set version to 0100
        $sRandomData[8] = chr(ord($sRandomData[8]) & 0x3f | 0x80); // set bits 6-7 to 10

        return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($sRandomData), 4));
    }
737161
public function formatListDetails(): string
    {
        return
            $this->formatFirstMajorFact(Gedcom::BIRTH_EVENTS, 1) .
            $this->formatFirstMajorFact(Gedcom::DEATH_EVENTS, 1);
    }
876162
public function toString()
    {
        if ($this->max !== -1) {
            return vsprintf('{length: %d <= x <= %d}', [
                $this->min,
                $this->max,
            ]);
        }

        return vsprintf('{length: %d <= x}', [
            $this->min,
        ]);
    }
97402
public function format() {

        /*         * Add the mandatary props* */
        if (!is_null($this->locale)) {
            $result[self::LOCALE_KEY] = $this->locale;
        }

        if (!is_null($this->sender)) {
            $result[self::SENDER_KEY] = $this->sender;
        }

        if (!is_null($this->senderEmail)) {
            $result[self::SENDEREMAIL_KEY] = $this->senderEmail;
        }
        if (!is_null($this->subject)) {
            $result[self::SUBJECT_KEY] = $this->subject;
        }
        if (!is_null($this->contactsListID)) {
            $result[self::CONTACTLISTID_KEY] = $this->contactsListID;
        }
        /*         * Add the optional props if any* */
        if (!is_null($this->optionalProperties)) {
            $result = array_merge($result, $this->optionalProperties);
        }


        return $result;
    }
1208658
public function getColumns()
    {
        $rawColumns = substr($this->data, 64, 128);
        $columnsString = rtrim($rawColumns, "\0");
        return explode("\0", $columnsString);
    }
812241
public function formatMemoryUsage()
    {
        $log = '';
        if (function_exists('memory_get_usage')) {
            $kb = ( int ) (memory_get_usage() / 1024);
            $mb = round($kb / 1024, 3);
            $log .= 'Memory usage: ' . $mb . ' MB';

            if (function_exists('memory_get_peak_usage')) {
                $peakKb = ( int ) (memory_get_peak_usage() / 1024);
                $peakMb = round($peakKb / 1024, 3);
                $log .= ' (peak: ' . $peakMb . ' MB)';
            }
            $log .= '<br />';

            if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
                $kb = ( int ) (memory_get_usage(true) / 1024);
                $mb = round($kb / 1024, 3);
                $log .= 'System memory usage: ' . $mb . ' MB';

                if (function_exists('memory_get_peak_usage')) {
                    $peakKb = ( int ) (memory_get_peak_usage(true) / 1024);
                    $peakMb = round($peakKb / 1024, 3);
                    $log .= ' (peak: ' . $peakMb . ' MB)';
                }
                $log .= '<br />';
            }
        }

        return $log;
    }
1097881
public function toUpper()
        {
            $stringLen = strlen($this->dataStr);
            $p = 0;
            
            while ($p<$stringLen) {
                $mode = self::identifyMode(substr($this->dataStr, $p), $this->modeHint);
                if($mode == QR_MODE_KANJI) {
                    $p += 2;
                } else {
                    if (ord($this->dataStr[$p]) >= ord('a') && ord($this->dataStr[$p]) <= ord('z')) {
                        $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32);
                    }
                    $p++;
                }
            }

            return $this->dataStr;
        }
44719
public function getFormatPattern()
    {
        static $kyr = self::KYR_CHARS;

        switch (true) {
            // X000XX77_OR_X000XX777
            case \preg_match("~^[{$kyr}]{1}\d{3}[{$kyr}]{2}\d{2,3}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_1;

            // X000XX
            case \preg_match("~^[{$kyr}]{1}\d{3}[{$kyr}]{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_2;

            // XX00077
            case \preg_match("~^[{$kyr}]{2}\d{3}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_3;

            // 0000XX77
            case \preg_match("~^\d{4}[{$kyr}]{2}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_4;

            // XX000077
            case \preg_match("~^[{$kyr}]{2}\d{4}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_5;

            // X000077
            case \preg_match("~^[{$kyr}]{1}\d{4}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_6;

            // 000X77
            case \preg_match("~^\d{3}[{$kyr}]{1}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_7;

            // 0000X77
            case \preg_match("~^\d{4}[{$kyr}]{1}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_8;
        }
    }