%PDF- %PDF-
Direktori : /home2/vacivi36/code/vendor/rector/rector/packages/Skipper/ |
Current File : //home2/vacivi36/code/vendor/rector/rector/packages/Skipper/Fnmatcher.php |
<?php declare (strict_types=1); namespace Rector\Skipper; final class Fnmatcher { public function match(string $matchingPath, string $filePath) : bool { $normalizedMatchingPath = $this->normalizePath($matchingPath); $normalizedFilePath = $this->normalizePath($filePath); if (\fnmatch($normalizedMatchingPath, $normalizedFilePath)) { return \true; } // in case of relative compare return \fnmatch('*/' . $normalizedMatchingPath, $normalizedFilePath); } private function normalizePath(string $path) : string { return \str_replace('\\', '/', $path); } }