2323
2424final class FractionBuilder implements Arrayable
2525{
26+ /**
27+ * The array of "then" hooks.
28+ *
29+ * @var array<int, string>
30+ */
2631 private array $ then = [];
2732
33+ /**
34+ * Configuration for queueing the action.
35+ */
2836 private ?QueueUsing $ queued = null ;
2937
38+ /**
39+ * Configuration for deferring the action.
40+ */
3041 private ?DeferUsing $ deferred = null ;
3142
3243 public function __construct (
@@ -37,7 +48,10 @@ public function __construct(
3748 // ...
3849 }
3950
40- /** @throws BindingResolutionException|InvalidArgumentException|PreventDeferQueueSameTime
51+ /**
52+ * Run the action.
53+ *
54+ * @throws BindingResolutionException|InvalidArgumentException|PreventDeferQueueSameTime
4155 */
4256 public function __invoke (...$ arguments ): mixed
4357 {
@@ -73,13 +87,21 @@ public function __invoke(...$arguments): mixed
7387 return $ result ;
7488 }
7589
90+ /**
91+ * Register a "then" hook.
92+ */
7693 public function then (string |UnitEnum $ action ): self
7794 {
7895 $ this ->then [] = new Then ($ this ->action , $ action );
7996
8097 return $ this ;
8198 }
8299
100+ /**
101+ * Enable the action to be queued.
102+ *
103+ * @return $this
104+ */
83105 public function queued (
84106 mixed $ delay = null ,
85107 ?string $ queue = null ,
@@ -90,6 +112,11 @@ public function queued(
90112 return $ this ;
91113 }
92114
115+ /**
116+ * Enable the action to be deferred.
117+ *
118+ * @return $this
119+ */
93120 public function deferred (
94121 bool $ always = false ,
95122 ?string $ name = null ,
@@ -99,6 +126,7 @@ public function deferred(
99126 return $ this ;
100127 }
101128
129+ /** {@inheritDoc} */
102130 public function toArray (): array
103131 {
104132 return [
0 commit comments