-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnodes.php
More file actions
29 lines (24 loc) · 689 Bytes
/
Copy pathnodes.php
File metadata and controls
29 lines (24 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
use PocketFlow\Node;
use PocketFlow\SharedStore;
class ExampleNode extends Node
{
public function prep(SharedStore $shared): mixed
{
// Prepare input data for this node
return null;
}
public function exec(mixed $prepResult): mixed
{
// Execute the node's core logic
return 'Hello from PocketFlow-PHP!';
}
public function post(SharedStore $shared, mixed $prepResult, mixed $execResult): ?string
{
// Process results and decide the next action
$shared->result = $execResult;
return null; // null = stop the flow
}
}