@param  string $source

@return self
433694
public static function fromPattern($source) {
        $source = preg_replace('/([\[\]\(\)\|]|\.\.\.)/', ' $1 ', $source);
        $source = preg_split('/\s+|(\S*<.*?'.'>)/', $source, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
        return new static($source, DocoptFormatError::class);
    }
56044
private function localize($source) {
		if (!stream_is_local($source) || ($this->args->git && isset($this->args->branch))) {
			$source = $this->download($source);
			$this->cleanup[] = new Task\Cleanup($source);
		}
		$source = realpath($source);
		if (!is_dir($source)) {
			$source = $this->extract($source);
			$this->cleanup[] = new Task\Cleanup($source);
			
			if (!$this->args->git) {
				$source = (new Task\PeclFixup($source))->run($this->verbosity());
			}
		}
		return $source;
	}
715488
public function orWhereRaw(string $condition): self
    {
        $this->condition->orWhere([new RawExp($condition)]);

        return $this;
    }
501765
public function set_source($source) {
        $filerecord = new stdClass;
        $filerecord->source = $source;
        $this->update($filerecord);
    }
1055600
public function setSource($source)
    {
        $controller = Controller::curr();
        $code = $controller->data()->Code;
        $updated = [];
        if (is_array($source) && !empty($source)) {
            foreach ($source as $key => $val) {
                $updated[ProductPage::getGeneratedValue($code, $this->getName(), $key, 'value')] = $val;
            }
        }
        $this->source = $updated;

        return $this;
    }
718921
public function remove(string $key): self
    {
        if (isset($this->headers[$key]) == true) {
            unset($this->headers[$key]);
        }

        return $this;
    }
944940
public static function source($source)
    {
        $ins         = new static();
        $ins->source = $source;

        //inherit cid from datafilter
        if ($ins->source instanceof \Zofe\Rapyd\DataFilter\DataFilter) {
            $ins->cid = $ins->source->cid;
        }
        //generate new component id
        else {
            $ins->cid = $ins->getIdentifier();
        }

        return $ins;
    }
135479
public function load($source)
    {
        if ($this->isFile($source)) {
            return $this->loadFile($source);
        } else {
            return $this->loadString($source);
        }
    }
157214
public function withContext(RelationContext $source, RelationContext $target = null): self
    {
        $definition = clone $this;
        $definition->sourceContext = $source;
        $definition->targetContext = $target;

        return $definition;
    }
1052239
public function generate($source = null)
    {
        $this->getImporter()->setInput($source);

        // Add these dependencies to collection
        $this->addRawDependenciesToCollection($this->getImporter()->import());

        // Return this
        return $this;
    }
763612
public function remove(string $key): self
    {
        $this->data = Arr::remove($this->data, $key);
        return $this;
    }
802187
public function addOrder($source)
    {
        $orders   = $this->getOrders();
        $orders[] = $source;

        $this->setData('orders', $orders);

        return $this;
    }
458873
public function copy($source, $destination = null)
    {
        if ($destination === null) {
            $destination = basename($source);
        }

        $this->toCopy[] = array($source, $destination);

        return $this;
    }
460287
public function load($source)
    {
        $source = mb_convert_encoding($source, 'HTML-ENTITIES', mb_detect_encoding($source));
        $dom = new \DOMDocument();

        // Try to load the source as standard XML document first, then as HTML document
        if (!$dom->loadXML($source, LIBXML_NOWARNING | LIBXML_NOERROR)) {
            $dom = $this->htmlParser->loadHTML($source);
        }

        return $dom;
    }
347945
public function setSource($source)
    {
        if ($this->memorize) {
            if (isset($_GET[$this->skip_var])) {
                $this->skip = $this->memorize('skip', (int) $_GET[$this->skip_var]);
            } else {
                $this->skip = (int) $this->recall('skip');
            }
        } else {
            $this->skip = @$_GET[$this->skip_var] + 0;
        }

        // Start iterating early ($source = DSQL of model)
        if ($source instanceof SQL_Model) {
            $source = $source->_preexec();
        }

        if ($source instanceof DB_dsql) {
            $source->limit($this->ipp, $this->skip);
            $source->calcFoundRows();
            $this->source = $source;
        } elseif ($source instanceof \atk4\data\Model) {
            $this->source = $source->setLimit($this->ipp, $this->skip);
        } elseif ($source instanceof Model) {
            $this->source = $source->setLimit($this->ipp, $this->skip);
        } else {
            // NOTE: no limiting enabled for unknown data source
            $this->source = &$source;
        }
    }
623663
public function setStream(string $stream): self
    {
        $this->stream = $stream;
        $this->createByteCache();
        return $this;
    }
1118100
public function prepend($source)
    {
        $importNode = $this->ownerDocument->importNode($this->ownerDocument->importSourceNode($source), true);

        return $this->appendChild($importNode);
    }