File tree Expand file tree Collapse file tree 2 files changed +40
-3
lines changed Expand file tree Collapse file tree 2 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Pharaonic \Laravel \Executor \Classes ;
4+
5+ class ExecutorItem
6+ {
7+ public Executor $ executor ;
8+ public string $ path ;
9+
10+ public function __construct (Executor $ executor , string $ path )
11+ {
12+ $ this ->executor = $ executor ;
13+ $ this ->path = $ path ;
14+ }
15+
16+ /**
17+ * Get info about the executor.
18+ *
19+ * @return array
20+ */
21+ public function info ()
22+ {
23+ return [
24+ 'type ' => $ this ->executor ->type ,
25+ 'tags ' => $ this ->executor ->tags ,
26+ 'servers ' => $ this ->executor ->servers ,
27+ 'path ' => $ this ->path ,
28+ ];
29+ }
30+ }
Original file line number Diff line number Diff line change @@ -11,7 +11,14 @@ class ExecutorPool
1111 *
1212 * @var array
1313 */
14- private array $ paths = [];
14+ protected array $ paths = [];
15+
16+ /**
17+ * All executors items.
18+ *
19+ * @var array
20+ */
21+ protected array $ items = [];
1522
1623 public function __construct ()
1724 {
@@ -44,10 +51,10 @@ public function getPaths(): array
4451 *
4552 * @return array
4653 */
47- public function getExecutorsPaths ()
54+ public function collect ()
4855 {
4956 $ list = [];
50-
57+
5158 foreach ($ this ->paths as $ path ) {
5259 if (File::isDirectory ($ path ) && ! File::isEmptyDirectory ($ path , true )) {
5360 foreach (File::files ($ path ) as $ executor ) {
You can’t perform that action at this time.
0 commit comments