Compare commits

..

2 Commits

Author SHA1 Message Date
Dave M. 0061a8abb0 - Removing annotations replaced by attributes 2023-11-03 19:54:24 -04:00
Dave M. 3622e11fcc - Some bugfixes linked to attributes 2023-07-09 12:42:40 -04:00
3 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@
"authors": [ "authors": [
{ {
"name": "Dave Mc Nicoll", "name": "Dave Mc Nicoll",
"email": "mcndave@gmail.com" "email": "info@mcnd.ca"
} }
], ],
"require": { "require": {

View File

@ -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 = "",

View File

@ -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) {