Adds a trailing slash to this path.

@return PathInterface A new path instance with a trailing slash suffixed to this path.
771611
public function joinTrailingSlash()
    {
        if ($this->hasTrailingSeparator()) {
            return $this;
        }

        return $this->createPath(
            $this->atoms(),
            $this instanceof AbsolutePathInterface,
            true
        );
    }
458444
public function createPath()
    {
        if ($this->isReference()) {
            throw $this->noChildrenAllowed();
        }
        $p = new Path($this->project);
        $this->elements[] = $p;
        $this->checked = false;

        return $p;
    }
431936
public function _slashify($path, $isDirectory)
    {
        $p = (string) $path;

        if (self::$separator !== '/') {
            $p = str_replace(self::$separator, '/', $p);
        }

        if (!StringHelper::startsWith('/', $p)) {
            $p = '/' . $p;
        }

        if (!StringHelper::endsWith('/', $p) && $isDirectory) {
            $p .= '/';
        }

        return $p;
    }
358343
protected function addRoutes()
    {
        // Define a "not found" route
        $this->router->add('/', [$this, 'unknownEndpoint']);

        // Only add these routes if we're using authorization
        if ($this->configuration->getUseAuthorization()) {
            // Token route for requesting tokens
            $this->router->add('/token', [$this, 'token']);

            if ($this->configuration->getAuthorizationMode() >= 2) {
                // Token route for authorizing a client
                $this->router->add('/authorize', [$this, 'authorize']);
            }
        }

        return $this;
    }
985205
public function append($path) {
		$path = $this->normalizePath($path);
		
		$this->inputFiles->push($path);
		
		return $this;
	}
1093040
public function append($segment): self
    {
        $segment = $this->filterComponent($segment);
        if (null === $segment) {
            throw new TypeError('The appended path can not be null');
        }

        return new self(
            rtrim($this->path->__toString(), self::SEPARATOR)
            .self::SEPARATOR
            .ltrim($segment, self::SEPARATOR)
        );
    }
593289
public function addPath($path) {
        if (substr($path, 0, 3) === '../') {
            $path = realpath(__DIR__ . '/' . $path);
        }

        if (substr($path, -1) !== '/') {
            $path .= '/';
        }

        $this->_paths[] = $path;

        return $this;
    }
444809
protected function assemblePath() {
		$root = $this->isRelative() ? '' : '/';
		
		if ($this->path === null) {
			return $root;
		}
		
		return $root . ltrim($this->path, '/');
	}
314454
def path_with_slashes(path)
      path = '/' + path unless path.start_with?('/')
      path << '/' unless path.end_with?('/')
      path
    end
1254753
public function add()
    {
        $args = func_get_args();

        if (count($args) == 1) {
            list($middleware) = $args;
            if (!is_null($this->currentGroup)) {
                //middlewares no group
                $this->groupMiddlewares[$this->currentGroup][] = $middleware;
            } else {
                //middlewares na rota
                $lastRoute = $this->findLastRoute();
                $lastRoute->addMiddleware($middleware);
            }

        } elseif(count($args) > 1) {
            list($routeNames, $middlewares) = $args;
            foreach ($routeNames as $routeName) {
                if (isset($this->middlewares[$routeName])) {
                    $currentMiddlewares = $this->middlewares[$routeName];
                    $this->middlewares[$routeName] = array_merge($middlewares, $currentMiddlewares);
                } else {
                    $this->middlewares[$routeName] = $middlewares;
                }
            }
        }
        return $this;
    }
590718
public function add_path(string $path)
    {
        $path = \trailingslashit($path);
        $this->paths[] = $path;
        $this->parse_files($path);
    }
598154
protected function buildPath()
    {
        $this->basename = $this->filename;

        if (!empty($this->extension)) {
            $this->basename .= '.' . $this->extension;
        }

        $this->path = $this->dirname;

        if (!empty($this->basename)) {
            $this->path .= '/' . $this->basename;
        }

        return $this;
    }
681866
public function asEmbedPath()
    {
        $parent_entity = $this->getParent();
        if (!$parent_entity) {
            return '';
        }

        $path_parts = [];
        $current_entity = $this;
        while ($parent_entity) {
            $parent_attr_name = $current_entity->getType()->getParentAttribute()->getName();
            $path_parts[] = sprintf(
                '%s[%d]',
                $current_entity->getType()->getPrefix(),
                $parent_entity->getValue($parent_attr_name)->getKey($current_entity)
            );
            $path_parts[] = $parent_attr_name;
            if (!$parent_entity->getType()->isRoot()) {
                $path_parts[] = $parent_entity->getType()->getPrefix();
            }
            $current_entity = $parent_entity;
            $parent_entity = $parent_entity->getParent();
        }

        return implode('.', array_reverse($path_parts));
    }
1224836
public function getExtension()
    {
        if (version_compare(PHP_VERSION, '5.3.6') >= 0) {
            return parent::getExtension();
        } else {
            return ltrim(pathinfo($this->getAbsolutePath(), PATHINFO_EXTENSION), '.');
        }
    }
25863
public function initAll(string $path): PathInfoInterface
    {
        $this->path = $path;
        [$this->wrappers, $this->root, $this->dirs] = $this->getPathParts();
        return $this;
    }
21163
public function unhardenedPath() {
        $path = $this->path;

        foreach ($path as $i => $level) {
            $path[$i] = str_replace("'", "", $level);
        }

        return new static($path);
    }
570219
public UrlBuilder addPath(String path) {
		if (path.charAt(0) == '/' && baseUrl.endsWith("/")) {
			baseUrl = baseUrl + path.substring(1);
		} else {
			baseUrl = baseUrl + path;
		}
		return this;
	}