19 lines
571 B
PHP

<?php
namespace Notes\Route\Attribute\Object;
#[\Attribute(\Attribute::TARGET_CLASS)]
class Route implements \Notes\Attribute {
public function __construct(
public string|array $method = [ "GET", "POST" ],
# NULL will fallback on nearest base
public null|string $base = null,
public null|bool $inheritRoutes = null, # true or false will skip others attribute from parents after, null = skipped for this one.
){}
public function getBase() : ?string
{
return $this->base ? rtrim($this->base, '/') : null;
}
}