Parse a variable line

@param string $varLine
@return Variable
3631
public static function parse($varLine)
    {
        $parts = explode('=', $varLine, 2);
        if (!$parts || count($parts) !== 2) {
            throw new \InvalidArgumentException("Line does not appear to contain a variable");
        }

        $variable = new Variable();
        $variable->setName(trim(array_shift($parts)))
            ->setValue(trim(array_shift($parts)));

        return $variable;
    }
1313503
private function parseCodeLine(string $line): Line
    {
        if (strlen($line) == 0) {
            return new Line(Line::EXISTED, '');
        }

        $firstChar = $line[0];
        $cleanLine = rtrim(substr($line, 1));

        return new Line(Line::$opsMap[$firstChar], $cleanLine);
    }
821149
public static function parseFirstLine($firstLine)
    {
        $parts = static::splitFirstLine($firstLine);
        $street = array_shift($parts);
        $houseNumber = null;
        if (static::couldBePartOfHouseNumber(end($parts))) {
            $houseNumber = array_pop($parts);
        }
        while ($parts) {
            $first = reset($parts);
            if (preg_match('/\\d/', $first)) {
                break;
            }
            $street .= ' '.array_shift($parts);
        }
        while ($parts) {
            if (static::couldBePartOfHouseNumber(end($parts))) {
                $houseNumber = array_pop($parts).' '.$houseNumber;
            } else {
                break;
            }
        }
        while ($parts) {
            $street .= ' '.array_shift($parts);
        }
        $street = trim($street);
        if ($houseNumber) {
            $houseNumber = trim($houseNumber);
        }
        return [$street, $houseNumber];
    }
69491
public function parseLine($line) {

        $data = explode(";", $line);
        $i    = -1;

        $model = new Customer();
        $model->setCustomerNumber(IntegerHelper::parseString($data[++$i]));
        $model->setTitle($this->decodeString($data[++$i]));
        $model->setSurname($this->decodeString($data[++$i]));
        $model->setFirstname($this->decodeString($data[++$i]));
        $model->setStreet($this->decodeString($data[++$i]));
        $model->setPCode($this->decodeString($data[++$i]));
        $model->setCity($this->decodeString($data[++$i]));
        $model->setCountry($this->decodeString($data[++$i]));
        $model->setTaxCode($this->decodeString($data[++$i]));
        $model->setIdDocumentNo($this->decodeString($data[++$i]));
        $model->setTelephone($this->decodeString($data[++$i]));
        $model->setRentalAgreementNo($this->decodeString($data[++$i]));
        $model->setBeginDate($this->decodeDate($data[++$i]));
        $model->setTerminationDate($this->decodeDate($data[++$i]));
        $model->setDeposit(IntegerHelper::parseString($data[++$i]));
        $model->setMaximumLevel(IntegerHelper::parseString($data[++$i]));
        $model->setRemarks($this->decodeString($data[++$i]));
        $model->setDatetimeLastModification($this->decodeDateTime($data[++$i]));
        $model->setBlocked(BooleanHelper::parseString($data[++$i]));
        $model->setBlockedDate($this->decodeDate($data[++$i]));
        $model->setDeletedRecord(BooleanHelper::parseString($data[++$i]));
        $model->setTicketReturnAllowed(BooleanHelper::parseString($data[++$i]));
        $model->setGroupCounting(BooleanHelper::parseString($data[++$i]));
        $model->setEntryMaxLevelAllowed(BooleanHelper::parseString($data[++$i]));
        $model->setMaxLevelCarPark(BooleanHelper::parseString($data[++$i]));
        $model->setRemarks2($this->decodeString($data[++$i]));
        $model->setRemarks3($this->decodeString($data[++$i]));
        $model->setDivision($this->decodeString($data[++$i]));
        $model->setEmail($this->decodeString($data[++$i]));
        $model->setCountingNeutralCards(BooleanHelper::parseString($data[++$i]));
        $model->setNationality($this->decodeString($data[++$i]));
        $model->setAccountingNumber($this->decodeString($data[++$i]));

        return $model;
    }
1224066
protected function parse_properties($lines) {
        $result= NULL;
        foreach($lines as $i=>$line) {
            if(empty($line) || !isset($line) || strpos($line,"#") === 0){
                continue;
            }
            $key = substr($line,0,strpos($line,'='));
            $value = substr($line,strpos($line,'=') + 1, strlen($line));
            $result[$key] = $value;
        }
        return $result;
    }
1058437
protected function parseTag($line)
    {
        $tagAndValue = [];
        if (preg_match('/@[A-Za-z0-9\\\\]+\\\\([A-Za-z0-9]+)(?:\\((.*)\\))?$/', $line, $tagAndValue) === 0) {
            $tagAndValue = preg_split('/\s/', $line, 2);
        } else {
            array_shift($tagAndValue);
        }
        $tag = strtolower(trim($tagAndValue[0], '@'));
        if (count($tagAndValue) > 1) {
            $this->tags[$tag][] = trim($tagAndValue[1], ' "');
        } else {
            $this->tags[$tag] = [];
        }
    }
1201366
public function parseLine($line) {

        $data = explode(";", $line);
        $i    = -1;

        $model = new StartRecordFormat();
        $model->setVersionRecordStructure(IntegerHelper::parseString($data[++$i]));
        $model->setFacilityNumber(IntegerHelper::parseString($data[++$i]));
        $model->setDateFile($this->decodeDate($data[++$i]));
        $model->setNumberRecords(IntegerHelper::parseString($data[++$i]));
        $model->setCurrency($this->decodeString($data[++$i]));

        return $model;
    }
870370
private function parseStatusLine($line) {
		if (empty($line)) {
			throw new \Exception("Empty status line provided.");
		}
		preg_match('/HTTP\/([^[:space:]])+[[:space:]]+([0-9]*)(.*)/i', $line, $result);
		$this->statusCode = (int)$result[2];
	}
1279
protected function parseTag($line) {
		$matches = [];
		if (!preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us', $line, $matches)) {
			throw new \InvalidArgumentException('Invalid tag line detected: ' . $line);
		}
		
		$tagName = $matches[1];
		$content = isset($matches[2]) ? $matches[2] : '';
		
		return TagFactory::create($tagName, $content);
	}
201631
protected function parse_vars($string)
	{
		foreach ($this->vars as $var => $val)
		{
			$string = str_replace("%$var%", $val, $string);
		}

		return $string;
	}
1127739
private function normalizeChangedLine(string $line): string
    {
        $normalized = substr($line, 1);

        return false === $normalized ? $line : $normalized;
    }
56281
function getFromDefine($line)
    {
        $line = "<?php $line"; // Trick the parser that we are in PHP file, instead of analyzing a single line

        $state = 0;
        $key = $value = '';

        $tokens = token_get_all($line);
        $token = reset($tokens);

        while ($token) {
            if (is_array($token)) {
                if ($token[0] == T_WHITESPACE || $token[0] == T_COMMENT || $token[0] == T_DOC_COMMENT) {
                    // do nothing
                } else {
                    if ($token[0] == T_STRING && strtolower($token[1]) == 'define') {
                        $state = 1;
                    } else {
                        if ($state == 2 && $this->isConstantToken($token[0])) {
                            $key = $token[1];
                            $state = 3;
                        } else {
                            if ($state == 4 && $this->isConstantToken($token[0])) {
                                $value = $token[1];
                                $state = 5;
                            }
                        }
                    }
                }
            } else {
                $symbol = trim($token);
                if ($symbol == '(' && $state == 1) {
                    $state = 2;
                } else {
                    if ($symbol == ',' && $state == 3) {
                        $state = 4;
                    } else {
                        if ($symbol == ')' && $state == 5) {
                            $state = 0;

                            yield [$this->stripQuotes($key), $this->getNativeValueFromDefinition($value)];
                        }
                    }
                }
            }
            $token = next($tokens);
        }
    }
112733
private static function setLineIfPrevious(&$line)
    {
        static $previousLine = '';

        if ($previousLine) {
            $line = $previousLine.' '.trim($line);
            $previousLine = '';
        }

        if (preg_match('/(.+)\\\$/', $line, $container)) {
            $previousLine = $container[1];
        }

        return $previousLine;
    }
1239355
public function parseLine($line) {

        $data = explode(";", $line);
        $i    = -1;

        $model = new User();
        $model->setUserNumber(IntegerHelper::parseString($data[++$i]));
        $model->setCustomerNumber(IntegerHelper::parseString($data[++$i]));
        $model->setTitle($this->decodeString($data[++$i]));
        $model->setSurname($this->decodeString($data[++$i]));
        $model->setFirstname($this->decodeString($data[++$i]));
        $model->setDateBirth($this->decodeDate($data[++$i]));
        $model->setParkingSpace($this->decodeString($data[++$i]));
        $model->setRemarks($this->decodeString($data[++$i]));
        $model->setDatetimeLastModification($this->decodeDateTime($data[++$i]));
        $model->setDeletedRecord(BooleanHelper::parseString($data[++$i]));
        $model->setIdentificationNumber($this->decodeString($data[++$i]));
        $model->setCheckLicensePlate(BooleanHelper::parseString($data[++$i]));
        $model->setPassageLicensePlatePermitted(BooleanHelper::parseString($data[++$i]));
        $model->setExcessTimesCreditCard(BooleanHelper::parseString($data[++$i]));
        $model->setCreditCardNumber($this->decodeString($data[++$i]));
        $model->setExpiryDate($this->decodeDate($data[++$i]));
        $model->setRemarks2($this->decodeString($data[++$i]));
        $model->setRemarks3($this->decodeString($data[++$i]));
        $model->setDivision($this->decodeString($data[++$i]));
        $model->setEmail($this->decodeString($data[++$i]));
        $model->setGroupCounting(BooleanHelper::parseString($data[++$i]));
        $model->setETicketTypeP(IntegerHelper::parseString($data[++$i]));
        $model->setETicketEmailTelephone($this->decodeString($data[++$i]));
        $model->setETicketAuthentication(IntegerHelper::parseString($data[++$i]));
        $model->setETicketServiceTyp(IntegerHelper::parseString($data[++$i]));
        $model->setETicketServiceArt(IntegerHelper::parseString($data[++$i]));

        return $model;
    }
1122883
protected function splitLine($line)
    {
        $chunks = explode(';', $line);
        if (count($chunks) !== 6) {
            throw new InvalidValueException('Line "' . $line . '" is malformed');
        }

        return array_map('trim', $chunks);
    }
973186
protected function formatLine($line)
    {
        if ($line instanceof Htmlable) {
            return $line;
        }

        if (is_array($line)) {
            return implode(' ', array_map('trim', $line));
        }

        return trim(implode(' ', array_map('trim', preg_split('/\\r\\n|\\r|\\n/', $line))));
    }
71544
private function getFromConst($line)
    {
        $eq_pos = strpos($line, '=');
        $semicolon_pos = strrpos($line, ';');

        $constant_name = trim(substr($line, 6, $eq_pos - 6));
        $value = trim(substr($line, $eq_pos + 1, $semicolon_pos - $eq_pos - 1));

        return [$constant_name, $this->getNativeValueFromDefinition($value)];
    }