public function testItCanBeCreatedFromThePattern() { assertSame('No files found matching pattern: "*.json".', NoMatchingFilesException::fromPattern('*.json')->getMessage()); }
/** * @param string $pattern * * @throws NoMatchingFilesException * @throws InvalidArgumentException * * @return $this */ public function configFromFiles($pattern) { Assertion::string($pattern); $locator = new FileReader\FileLocator(); $files = $locator->locate($pattern); if (count($files) === 0) { throw NoMatchingFilesException::fromPattern($pattern); } foreach ($files as $filename) { $this->readFileAndMergeConfig($filename); } return $this; }