Compare commits
2 Commits
attributes
...
master
Author | SHA1 | Date |
---|---|---|
Dave M. | 0061a8abb0 | |
Dave M. | 3622e11fcc |
|
@ -6,7 +6,7 @@
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Dave Mc Nicoll",
|
"name": "Dave Mc Nicoll",
|
||||||
"email": "mcndave@gmail.com"
|
"email": "info@mcnd.ca"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace Notes\Route\Attribute\Object;
|
namespace Notes\Route\Attribute\Object;
|
||||||
|
|
||||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||||
class Route implements \Notes\Annotation {
|
class Route implements \Notes\Attribute {
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public string|array $method = [ "GET", "POST" ],
|
public string|array $method = [ "GET", "POST" ],
|
||||||
public string $base = "",
|
public string $base = "",
|
||||||
|
|
|
@ -39,8 +39,8 @@ class RouteFetcher {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->annotations = [
|
$this->annotations = [
|
||||||
'object' => [ Annotation\Object\Route::class, Attribute\Object\Route::class ],
|
'object' => [ Attribute\Object\Route::class ],
|
||||||
'method' => [ Annotation\Method\Route::class ],
|
'method' => [ Attribute\Method\Route::class ],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,8 +111,8 @@ class RouteFetcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($annotations['method']) ) {
|
if ( isset($annotations['method']) ) {
|
||||||
$routeList = $objectResolver->getAnnotationListFromClassname( $annotations['method'], false );
|
$routeList = $objectResolver->getAttributeListFromClassname( $annotations['method'], false );
|
||||||
;
|
|
||||||
foreach($routeList as $func => $routes) {
|
foreach($routeList as $func => $routes) {
|
||||||
if (is_array($routes)) {
|
if (is_array($routes)) {
|
||||||
foreach ($routes as $route) {
|
foreach ($routes as $route) {
|
||||||
|
|
Loading…
Reference in New Issue