classes/Files/PathResolver.php
public function locate($basenameOrNames, $extensionOrExtensions)
	{
		$basenames = (array) $basenameOrNames;
		$extensions = (array) $extensionOrExtensions;

		$located = [];

		foreach ($basenames as $basename) {
			foreach ($extensions as $ext) {
				$path = $basename.$ext;
				if (file_exists($path)) {
					$located[] = $path;
				}
			}
		}

		return $located;
	}
public function locate($basenameOrNames, $extensionOrExtensions)
	{
		$basenames = (array) $basenameOrNames;
		$extensions = (array) $extensionOrExtensions;

		$located = [];

		foreach ($basenames as $basename) {
			foreach ($extensions as $ext) {
				$path = $basename.$ext;
				if (file_exists($path)) {
					$located[] = $path;
				}
			}
		}

		return $located;
	}
Based on a set of basenames (filename without extension) and a set of
possible extensions, find the files that exist.

@param  string|string[] $basenameOrNames
@param  string|string[] $extensionOrExtensions

@return string[]