*/ public static function read(array $filePaths, $shortCircuit = true) { $output = []; foreach ($filePaths as $filePath) { $content = self::readFromFile($filePath); if ($content->isDefined()) { $output[$filePath] = $content->get(); if ($shortCircuit) { break; } } } return $output; } /** * Read the given file. * * @param string $filePath * * @return \PhpOption\Option */ private static function readFromFile($filePath) { $content = @file_get_contents($filePath); /** @var \PhpOption\Option */ return Option::fromValue($content, false); } }