Paths.php 748 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. declare(strict_types=1);
  3. namespace Dotenv\Store\File;
  4. /**
  5. * @internal
  6. */
  7. final class Paths
  8. {
  9. /**
  10. * This class is a singleton.
  11. *
  12. * @codeCoverageIgnore
  13. *
  14. * @return void
  15. */
  16. private function __construct()
  17. {
  18. //
  19. }
  20. /**
  21. * Returns the full paths to the files.
  22. *
  23. * @param string[] $paths
  24. * @param string[] $names
  25. *
  26. * @return string[]
  27. */
  28. public static function filePaths(array $paths, array $names)
  29. {
  30. $files = [];
  31. foreach ($paths as $path) {
  32. foreach ($names as $name) {
  33. $files[] = \rtrim($path, \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR.$name;
  34. }
  35. }
  36. return $files;
  37. }
  38. }