Set the path inline.

@param mixed $path

@return self
436253
protected function setPath($path)
    {
        if ($path instanceof StringList) {
            $this->path = $path;

            return $this;
        }

        if ($path === '') {
            $this->path->setPrefix('')->setSource([]);
            return $this;
        }

        $hasLeadingSlash = ($path[0] == '/');
        $hasTrailingSlash = (substr($path, -1) == '/');

        $path = is_array($path) ? $path : explode('/', trim($path, '/ '));

        $this->path->setSource($path);

        $prefix = $hasLeadingSlash || $this->scheme ? '/' : '';
        $suffix = $hasTrailingSlash ? '/' : '';

        $this->path->setPrefix($prefix);
        $this->path->setSuffix($suffix);

        return $this;
    }
742313
public function setPublicPath($path)
    {
        if ($path === null) {
            $this->publicPath = null;
            return $this;
        }

        if (!is_string($path)) {
            throw new InvalidArgumentException(
                'The public path must be a string'
            );
        }

        $this->publicPath = rtrim(realpath($path), '\\/').DIRECTORY_SEPARATOR;
        return $this;
    }
1023803
private function addPath($path)
    {
        $path = $this->resolvePath($path);

        if ($this->validatePath($path)) {
            $this->paths[] = $path;
        }

        return $this;
    }
1065345
public function setPath($path) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');
        if ($path[0] != '/')   throw new StrutsConfigException('<mapping'.($this->name ? ' name="'.$this->name.'"':'').' path="'.$path.'": Illegal path (value must start with a slash "/").');

        $this->path = $path;
        return $this;
    }
597526
public function set($path, $value)
    {
        $this->callAtPath($path, function(&$offset) use ($value) {
            $offset = $value;
        }, true);

        return $this;
    }
1002590
protected function newPath(/*# string */ $path)/*# : Path */
    {
        list($mnt, $remain) = $this->splitPath($path);
        return new Path($path, $remain, $this->getFilesystemAt($mnt));
    }
1162503
public function assertPathBeginsWith($path)
    {
        $actualPath = parse_url($this->driver->getCurrentURL(), PHP_URL_PATH) ?? '';

        PHPUnit::assertStringStartsWith(
            $path, $actualPath,
            "Actual path [{$actualPath}] does not begin with expected path [{$path}]."
        );

        return $this;
    }
1041885
public function setPath($path)
    {
        if (!is_readable($path)) {
            throw new \InvalidArgumentException('The passed path is not readable: ' . $path);
        }

        $this->path = $path;
        $this->source = file_get_contents($path);

        return $this;
    }
836675
public function setRelativePath($path)
	{
		if ( ! is_string($path))
		{
			throw new \InvalidArgumentException('Относительный путь к ресурсу должен быть строкового типа.');
		}

		$this->isModified = true;
		$this->parameters['path'] = '/'.ltrim($path, ' /');

		return $this;
	}
985166
public function changePath($path)
    {
        $pathname = $this->createPathname($path, $this->getBasename(), $this->getExtension());

        return new static($pathname);
    }
746319
public function withPath(Path $path): self
    {
        $url = Structure::fromString((string) $this)
            ->withPath(
                new UrlPath((string) $path)
            )
            ->withQuery(new NullQuery)
            ->withFragment(new NullFragment);

        return new self(
            (string) $url
        );
    }
1115518
public function path($path = '')
    {
        $this->_sty->setTemplateDir($path);
        $this->root = $path;
        return $this;
    }
997119
public function setPath(Path $path = null)
    {
        if (!empty($this->path)) {
            $this->path->removeStep($this);
        }

        $this->path = $path;

        if (!empty($path)) {
            $path->addStep($this);
        }

        return $this;
    }
1087334
public function setPath($path)
    {
        if (is_array($path)) {
            $this->path = '/' . implode('/', $path);
        } else {
            $this->path = (string) $path;
        }

        return $this;
    }
952035
public function setRouteEndpoint($path)
    {
        $endpoint = $this->translator()->translation($path);

        foreach ($this->translator()->availableLocales() as $lang) {
            $endpoint[$lang] = trim($endpoint[$lang], '/');
        }

        $this->routeEndpoint = $endpoint;

        return $this;
    }
501780
public function setPath($path)
    {
        if(empty($path)) {
            $this->_path = '/';
        } else {
            $this->_path = $path;
        }

        return $this;
    }
1200729
public function setPath($path)
    {
        static $search  = [' ',   '?'];
        static $replace = ['%20', '%3F'];
        $this->path = str_replace($search, $replace, $path);

        return $this;
    }