public function listPipes() { return Strings::from(scandir($this->pipesDir))->diff(['.', '..'])->filter(function ($name) { $extensions = ['yml']; if ($this->allowPhp) { $extensions[] = 'php'; } return preg_match('~\\.(' . implode('|', $extensions) . ')$~', $name); })->replace('.yml', '')->replace('.php', '')->values(); }
/** * Converts collection to `Strings`. * Can be used to clone collection. * @return Strings */ public function asStrings() { return Strings::from($this->value); }