Compare commits

..

No commits in common. "master" and "attributes" have entirely different histories.

3 changed files with 4 additions and 4 deletions

View File

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

View File

@ -2,7 +2,7 @@
namespace Notes\Cronard\Attribute\Object; namespace Notes\Cronard\Attribute\Object;
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS)] #[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)]
class Cronard implements \Notes\Attribute { class Cronard implements \Notes\Attribute {
public function __construct( public function __construct(
public string $cron, public string $cron,

View File

@ -30,7 +30,7 @@ class TaskFetcher {
} }
else { else {
$this->annotations = [ $this->annotations = [
'method' => [ Attribute\Method\Cronard::class ], 'method' => [ Annotation\Method\Cronard::class, Attribute\Method\Cronard::class ],
]; ];
} }
} }
@ -80,7 +80,7 @@ class TaskFetcher {
# Should generate an equivalent of Ulmus's object reflection here ! # Should generate an equivalent of Ulmus's object reflection here !
$objectResolver = new ObjectResolver($class, true, true, false, true); $objectResolver = new ObjectResolver($class, true, true, false, true);
foreach($objectResolver->getAttributeListFromClassname( $this->annotations['method'], false ) as $func => $cronard) { foreach($objectResolver->getAnnotationListFromClassname( $this->annotations['method'], false ) as $func => $cronard) {
foreach($cronard as $task) { foreach($cronard as $task) {
$list[] = [ 'class' => $class, 'method' => $func, 'annotation' => $task ]; $list[] = [ 'class' => $class, 'method' => $func, 'annotation' => $task ];
} }