<?php

namespace Plainwork\Http;

class Dispatch
{
    private string $path = '';
    private array $params = [];

    public function __construct(string $path, array $params = [])
    {
        $this->path = $path;
        $this->params = $params;
    }

    public function getPath(): string
    {
        return $this->path;
    }

    public function getParams(): array
    {
        return $this->params;
    }

    public function withParam(string $k, $v): self
    {
        $ret = clone $this;
        $ret->params[$k] = $v;

        return $ret;
    }
}
