Initialises the parser using an array
containing each line of iCal content

@param  array $lines
@return void
160916
protected function initLines(array $lines)
    {
        $lines = $this->unfold($lines);

        if (stristr($lines[0], 'BEGIN:VCALENDAR') !== false) {
            $component = '';
            foreach ($lines as $line) {
                $line = rtrim($line); // Trim trailing whitespace
                $line = $this->removeUnprintableChars($line);

                if (!$this->disableCharacterReplacement) {
                    $line = $this->cleanData($line);
                }

                if ($this->replaceWindowsTimeZoneIds && strpos($line, 'TZID') !== false) {
                    $line = $this->replaceWindowsTimeZoneId($line);
                }

                $add = $this->keyValueFromString($line);

                $keyword = $add[0];
                $values  = $add[1]; // May be an array containing multiple values

                if (!is_array($values)) {
                    if (!empty($values)) {
                        $values = array($values); // Make an array as not already
                        $blankArray = array(); // Empty placeholder array
                        array_push($values, $blankArray);
                    } else {
                        $values = array(); // Use blank array to ignore this line
                    }
                } elseif (empty($values[0])) {
                    $values = array(); // Use blank array to ignore this line
                }

                // Reverse so that our array of properties is processed first
                $values = array_reverse($values);

                foreach ($values as $value) {
                    switch ($line) {
                        // https://www.kanzaki.com/docs/ical/vtodo.html
                        case 'BEGIN:VTODO':
                            if (!is_array($value)) {
                                $this->todoCount++;
                            }

                            $component = 'VTODO';
                            break;

                        // https://www.kanzaki.com/docs/ical/vevent.html
                        case 'BEGIN:VEVENT':
                            if (!is_array($value)) {
                                $this->eventCount++;
                            }

                            $component = 'VEVENT';
                            break;

                        // https://www.kanzaki.com/docs/ical/vfreebusy.html
                        case 'BEGIN:VFREEBUSY':
                            if (!is_array($value)) {
                                $this->freeBusyIndex++;
                            }

                            $component = 'VFREEBUSY';
                            break;

                        case 'BEGIN:VALARM':
                            if (!is_array($value)) {
                                $this->alarmCount++;
                            }

                            $component = 'VALARM';
                            break;

                        case 'END:VALARM':
                            $component = 'VEVENT';
                            break;

                        case 'BEGIN:DAYLIGHT':
                        case 'BEGIN:STANDARD':
                        case 'BEGIN:VCALENDAR':
                        case 'BEGIN:VTIMEZONE':
                            $component = $value;
                            break;

                        case 'END:DAYLIGHT':
                        case 'END:STANDARD':
                        case 'END:VCALENDAR':
                        case 'END:VFREEBUSY':
                        case 'END:VTIMEZONE':
                        case 'END:VTODO':
                            $component = 'VCALENDAR';
                            break;

                        case 'END:VEVENT':
                            if ($this->shouldFilterByWindow) {
                                $this->removeLastEventIfOutsideWindowAndNonRecurring();
                            }

                            $component = 'VCALENDAR';
                            break;

                        default:
                            $this->addCalendarComponentWithKeyAndValue($component, $keyword, $value);
                            break;
                    }
                }
            }

            $this->processEvents();

            if (!$this->skipRecurrence) {
                $this->processRecurrences();

                // Apply changes to altered recurrence instances
                if (!empty($this->alteredRecurrenceInstances)) {
                    $events = $this->cal['VEVENT'];

                    foreach ($this->alteredRecurrenceInstances as $alteredRecurrenceInstance) {
                        if (isset($alteredRecurrenceInstance['altered-event'])) {
                            $alteredEvent = $alteredRecurrenceInstance['altered-event'];
                            $key          = key($alteredEvent);
                            $events[$key] = $alteredEvent[$key];
                        }
                    }

                    $this->cal['VEVENT'] = $events;
                }
            }

            if ($this->shouldFilterByWindow) {
                $this->reduceEventsToMinMaxRange();
            }

            $this->processDateConversions();
        }
    }
664597
private function parseNormal(array $lines, $inline = false, $start)
    {
        foreach ($lines as $key => &$line) {
            $line = $this->parseInline($line);
            if (!preg_match("/^\s*$/", $line)) {
                $line = $this->markLine($start + $key) . $line;
            }
        }
        $str = trim(implode("\n", $lines));
        $str = preg_replace("/(\n\s*){2,}/", "</p><p>", $str);
        $str = preg_replace("/\n/", "<br>", $str);
        return preg_match("/^\s*$/", $str) ? '' : ($inline ? $str : "<p>{$str}</p>");
    }
1249626
protected function initialize(array $fields)
    {
        $this->content = new Content;
        $this->revision = new Revision;

        foreach ($fields as $field => $settings) {
            $this->data[$field] = $this->initializeField($field, $settings);
        }
    }
383423
public function preParseUses(array $nodes, PhpFileModelInterface $parent): void
    {
        foreach ($nodes as $node) {
            if ($node instanceof Use_) {
                $this->useNodeParser->invoke($node, $parent);
            } else {
                if ($node instanceof GroupUse) {
                    $this->groupUseNodeParser->invoke($node, $parent);
                }
            }
        }
    }
515178
public function delete($line, $lines)
    {
        foreach (range(0, $lines-1) as $offset) {
            $this->lines[$line+$offset-1] = null;
        }
        return $this;
    }
1284618
public function appendLines($lines, $indent = 0)
    {
        foreach ($lines as $line) {
            $this->appendLine($line, $indent);
        }
    }
76118
public function initialize($value, $filters = [])
    {
        $this->value = $value;

        if (empty($filters)) return;

        //If a comma separated string is passed in, we can explode on it
        if (is_string($filters)) {
            $this->filters = explode(',', $filters);
        } else if (!is_array($filters)) {
            $this->filters = [$this->filters];
        } else {
            $this->filters = $filters;
        }
    }
781316
protected function completeInvoiceLines(array $lines)
    {
        $lines = $this->addVatRateTo0PriceLines($lines);
        $lines = $this->recalculateLineData($lines);
        $lines = $this->completeLineMetaData($lines);
        return $lines;
    }
368423
public static function createArray($lines)
    {
        $op = Line::UNCHANGED;
        $hunks = [];
        /** @var Hunk $current */
        $current = null;
        foreach ($lines as $line) {
            switch ($line->getType()) {
                case Line::REMOVED:
                    if ($op != Line::REMOVED) {
                        // The last line was not removed so we start a new hunk.
                        $current = new Hunk($line, Hunk::REMOVED, $line->getIndex());
                    } else {
                        // continue adding the line to the hunk.
                        $current->addLine($line);
                    }
                    break;
                case Line::ADDED:
                    switch ($op) {
                        case Line::REMOVED:
                            // The hunk is a replacement.
                            $current->setType(Hunk::REPLACED);
                            $current->addLine($line);
                            break;
                        case Line::ADDED:
                            $current->addLine($line);
                            break;
                        case Line::UNCHANGED:
                            // Add a new hunk with the added type.
                            $current = new Hunk($line, Hunk::ADDED, $line->getIndex());
                            break;
                    }
                    break;
                case Line::UNCHANGED:
                    if ($current) {
                        // The hunk exists so add it to the array.
                        $hunks[] = $current;
                        $current = null;
                    }
                    break;
            }
            $op = $line->getType();
        }
        if ($current) {
            // The last line was part of a hunk, so add it.
            $hunks[] = $current;
        }

        return $hunks;
    }
98507
public function interpret($line)
    {
        $this->checkRowConsistency($line);

        if (!is_array($line)) {
            throw new InvalidLexicalException('line is must be array');
        }

        $this->notify($line);
    }
634872
public function lines(array $lines): Writer
    {
        foreach ($lines as $line) {
            $this->line($line);
        }

        return $this;
    }
526950
protected function initParser()
    {
        $this->parser->unregisterPlugin('function', 'intl');
        $this->parser->registerPlugin('function', 'intl', [$this, 'translate']);
        $this->parser->assign("locales", $this->locales);
    }
657859
private function parseLines($lines)
    {
        foreach ($lines as $line) {
            $line = preg_replace('#^[ \t\*]*#', '', $line);
            if (strlen($line) < 2) {
                continue;
            }
            if (preg_match('#@([^ ]+)(.*)#', $line, $matches)) {
                $tag_name = $matches[1];
                $tag_value = trim($matches[2]);
                // If this tag was already parsed, make its value an array
                if (isset($this->tags[$tag_name])) {
                    if (!is_array($this->tags[$tag_name])) {
                        $this->tags[$tag_name] = [$this->tags[$tag_name]];
                    }
                    $this->tags[$tag_name][] = $tag_value;
                } else {
                    $this->tags[$tag_name] = $tag_value;
                }
                continue;
            }
            $this->comment .= "$line\n";
        }
        $this->comment = trim($this->comment);
    }
1306751
private function registerInitializers(array $initializers)
    {
        foreach ($initializers as $initializer) {
            if (is_string($initializer) && class_exists($initializer)) {
                $initializer = new $initializer();
                if (! ($initializer instanceof InitializerInterface)) {
                    throw InvalidArgumentException::fromInvalidInitializer($initializer);
                }
            }
            if (is_callable($initializer)) {
                $this->initializers[] = $initializer;
            } else {
                throw InvalidArgumentException::fromInvalidInitializer($initializer);
            }
        }
    }
91735
public function setLines($lines)
    {
        if (!is_array($lines)) {
            $this->lines = array(
                $lines
            );
        } else {
            $this->lines = $lines;
        }

        return $this;
    }
648135
private function initialize($params = array())
	{
		if (count($params) > 0)
		{
			foreach ($params as $key => $value)
			{
				if (isset($this->{$key}))
				{
					$this->{$key} = $value;
				}
				else if (strpos($key, 'CURLOPT_') === 0) 
				{
					curl_setopt($this->ch, $key, $value);    
				}
			}
		}
	}
512096
private function parse()
    {
        $this->lines = [];
        $parser = new SegmentParser();
        foreach (explode(';', $this->sMappings) as $num => $sLine) {
            $sLine = trim($sLine);
            if ($sLine !== '') {
                $this->lines[$num] = Line::loadFromMappings($num, $sLine, $parser, $this->context);
            }
        }
    }