changed dir structure to handle second version of the book
This commit is contained in:
77
Vanilla/src/Entity/Route.php
Normal file
77
Vanilla/src/Entity/Route.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2022. Micha Espey <tracer@24unix.net>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Closure;
|
||||
|
||||
class Route
|
||||
{
|
||||
public function __construct(
|
||||
private string $name,
|
||||
private string $route,
|
||||
private string $regEx,
|
||||
private array $parameters,
|
||||
private Closure $callback
|
||||
)
|
||||
{
|
||||
// empty body
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): void
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getRoute(): string
|
||||
{
|
||||
return $this->route;
|
||||
}
|
||||
|
||||
public function setRoute(string $route): void
|
||||
{
|
||||
$this->route = $route;
|
||||
}
|
||||
|
||||
public function getRegEx(): string
|
||||
{
|
||||
return $this->regEx;
|
||||
}
|
||||
|
||||
public function setRegEx(string $regEx): void
|
||||
{
|
||||
$this->regEx = $regEx;
|
||||
}
|
||||
|
||||
public function getParameters(): array
|
||||
{
|
||||
return $this->parameters;
|
||||
}
|
||||
|
||||
public function setParameters(array $parameters): void
|
||||
{
|
||||
$this->parameters = $parameters;
|
||||
}
|
||||
|
||||
public function getCallback(): Closure
|
||||
{
|
||||
return $this->callback;
|
||||
}
|
||||
|
||||
public function setCallback(Closure $callback): void
|
||||
{
|
||||
$this->callback = $callback;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user