Add the part of path template.
Use TPL_* constants

@param  string $part
@return FilesBasedAbstract
764195
public function addPathTemplatePart($part) {
		if (! in_array($part, [
			self::TPL_DOMAIN,
			self::TPL_LOCALE
		], true)) {
			throw new InvalidParameter('Unknown part of the path template definition was given');
		}
		
		$this->pathTemplate[] = $part;
		
		return $this;
	}
898074
protected function buildDiffPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'pullrequests', $this->pr, 'diff', ...$parts);
    }
369381
public function append($parts)
    {
        if ($parts instanceof Message) {
            $parts = $parts->toArray();
        } elseif (!is_array($parts)) {
            throw new \Exception('Trying to append non array ('.gettype($parts).').');
        }
        $this->parts = array_merge($this->parts, $parts);

        return $this;
    }
880523
protected function buildApprovalPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'commit', $this->commit, 'approve', ...$parts);
    }
78455
public function prepend($path)
    {
        //argument 1 must be a string
        $error = Argument::i()->test(1, 'string');

        //each argument will be a path
        $paths = func_get_args();

        //for each path
        foreach ($paths as $i => $path) {
            //check for type errors
            $error->test($i + 1, $path, 'string');
            //add to path
            $this->data = $this->format($path).$this->data;
        }

        return $this;
    }
1161024
protected function buildCommentsPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'issues', $this->issue, 'comments', ...$parts);
    }
555134
public function includeFile(string $path): \Twig\Markup
    {
        return Template::raw(
            Twigpack::$plugin->manifest->getFile($path)
        );
    }
81738
protected function buildCommentsPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'commit', $this->commit, 'comments', ...$parts);
    }
1307164
public function appendToValue($part) : self {

      if (!is_string($part) and !is_numeric($part)) {
        throw new InvalidArgumentException('You can append only string to value');
      }

      $this->value .= $part;

      return $this;
    }
1198707
protected function getPartHeaderFromFile(&$part)
    {
        $start = $part['starting-pos'];
        $end = $part['starting-pos-body'];
        fseek($this->stream, $start, SEEK_SET);
        $header = fread($this->stream, $end - $start);
        return $header;
    }
855265
public function add(Expr\Part $part)
    {
        if(!$part instanceof ConditionalExpression) {
            throw new \RuntimeException(sprintf('ConditionalClause only accept ConditionalExpression, but "%s" is given', is_object($part) ? get_class($part) : gettype($part)));
        }

        if(!$this->expression) {
            $this->expression = $part;
        } else if(($this->expression instanceof LogicalExpression) && $this->expression->isType(LogicalExpression::TYPE_AND)) {
            // if root expression is AND logicalExpression, then append
            $this->expression->add($part);
        } else {
            // create new AND logicalExpression and append both current expression and new expresion
            $and = new Expr\LogicalExpression(array(
                    $this->expression,
                    $part
                ), Expr\LogicalExpression::TYPE_AND);

            $this->expression = $and;
        }
        return $this;
    }
511035
public function appendPathSegment($segment)
    {
        if (substr($this->path, -1) != static::PATH_SEGMENT_SEPARATOR) $this->path .= static::PATH_SEGMENT_SEPARATOR;
        if (substr($segment, 0, 1) == static::PATH_SEGMENT_SEPARATOR) $segment = substr($segment, 1);
        $this->path .= $segment;
        return $this;
    }
342497
public static function buildFromParseUrlParts(array $parts) {
        $url = '';

        $url .= isset($parts['scheme']) ? $parts['scheme'] : 'http';
        $url .= '://';

        if (isset($parts['user'])) {
            $url .= $parts['user'];

            if (isset($parts['pass'])) {
                $url .= ':' . $parts['pass'];
            }

            $url .= '@';
        }

        $url .= isset($parts['host']) ? $parts['host'] : '';
        $url .= isset($parts['port']) ? ':' . $parts['port'] : '';
        $url .= isset($parts['path']) ? $parts['path'] : '';
        $url .= isset($parts['query']) ? '?' . $parts['query'] : '';
        $url .= isset($parts['fragment']) ? '#' . $parts['fragment'] : '';

        return $url;
    }
624329
private function buildParts($template)
    {
        $template[0] = str_replace([
            '$NAMESPACE$',
            '$CLASS$',
            '$RULES$'
        ], [
            $this->namespace,
            'Create' . $this->className,
            $this->buildRules(0),
        ], $template[0]);

        $template[1] = str_replace([
            '$NAMESPACE$',
            '$CLASS$',
            '$RULES$'
        ], [
            $this->namespace,
            'Update' . $this->className,
            $this->buildRules(1),
        ], $template[1]);

        return $template;
    }
428488
protected function buildApprovalPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'pullrequests', $this->pr, 'approve', ...$parts);
    }
1021901
public function createNewContentPartFrom(ParentHeaderPart $part)
    {
        $mime = $this->partBuilderFactory->newPartBuilder($this->mimePartFactory)->createMessagePart();
        $this->copyContentHeadersAndContent($part, $mime, true);
        return $mime;
    }
756158
protected function getPartBody(&$part)
    {
        $body = '';
        if ($this->stream) {
            $body = $this->getPartBodyFromFile($part);
        } elseif ($this->data) {
            $body = $this->getPartBodyFromText($part);
        }

        return $body;
    }