diff options
Diffstat (limited to 'src/Group.php')
| -rw-r--r-- | src/Group.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/Group.php b/src/Group.php new file mode 100644 index 0000000..4e6c71e --- /dev/null +++ b/src/Group.php @@ -0,0 +1,65 @@ +<?php + +declare(strict_types=1); + +namespace Lightscale\Router; + +class Group +{ + use Concerns\HasAncestors; + + public function __construct( + private Router $router, + private ?Group $parent, + private ?string $prefix = null, + private ?string $name = null, + ) { + } + + public function getRouter(): Router + { + return $this->router; + } + + public function getParent(): ?static + { + return $this->parent; + } + + public function prefix(string $value): static + { + $this->prefix = $value; + + return $this; + } + + public function getPrefix(): ?string + { + return $this->prefix; + } + + public function getPath(): string + { + + } + + public function name(string $value): static + { + $this->name = $value; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + /** @param callable(self): void $cb */ + public function group(callable $cb): void + { + ($cb)(new GroupDefinition( + $this + )); + } +} |
