protected function addStoriesFromFolder(CliEngine $engine, Injectables $injectables, $folder)
{
// find everything under the folder
$filenames = $this->findStoriesInFolder($folder);
// did we find anything?
if (!count($filenames)) {
$msg = "no stories found in '{$folder}'" . PHP_EOL . PHP_EOL . "do your stories' filenames end in 'Story.php'?";
$this->output->logCliError($msg);
exit(1);
}
// create a set of story players
$storiesToPlay = [];
foreach ($filenames as $filename) {
$storiesToPlay[] = new Story_Player($filename, $injectables);
}
// all done
return $storiesToPlay;
}