�ɲɾ�����ӯ�����һ��ˣ��������С���˴��ͣ�������P���ҹ��ñ˽��ά�Բ��������˸߸ԣ�������ơ��ҹ��ñ�����ά�Բ���ˡ���˳^�ӣ������ӡ� ���ͯj�ӣ��ƺ���ӣ� ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!PKq#4]t鰏JsonFileSystem.phpnu[ */ public static function readFilePath(string $filePath) : array { $fileContents = FileSystem::read($filePath); return Json::decode($fileContents, \true); } /** * @param array $data */ public static function writeFile(string $filePath, array $data) : void { $json = Json::encode($data, \true); FileSystem::write($filePath, $json, null); } } PKq#4]Ő'??InitFilePathsResolver.phpnu[directories()->depth(0)->notPath(self::DO_NOT_INCLUDE_PATHS_REGEX)->in($projectDirectory)->sortByName(); /** @var SplFileInfo[] $rootDirectoryFileInfos */ $rootDirectoryFileInfos = \iterator_to_array($rootDirectoryFinder); $projectDirectories = []; foreach ($rootDirectoryFileInfos as $rootDirectoryFileInfo) { if (!$this->hasDirectoryFileInfoPhpFiles($rootDirectoryFileInfo)) { continue; } $projectDirectories[] = $rootDirectoryFileInfo->getRelativePathname(); } return $projectDirectories; } private function hasDirectoryFileInfoPhpFiles(SplFileInfo $rootDirectoryFileInfo) : bool { // is directory with PHP files? $phpFilesCount = Finder::create()->files()->in($rootDirectoryFileInfo->getPathname())->name('*.php')->count(); return $phpFilesCount !== 0; } } PKq#4]w(FileAndDirectoryFilter.phpnu[foundInGlob($path); $absolutePathsFound = \array_merge($absolutePathsFound, $foundPaths); } else { $absolutePathsFound[] = $path; } } return $absolutePathsFound; } /** * @return string[] */ private function foundInGlob(string $path) : array { /** @var string[] $paths */ $paths = (array) \glob($path); return \array_filter($paths, static function (string $path) : bool { return \file_exists($path); }); } } PKq#4]\  FilePathHelper.phpnu[filesystem = $filesystem; } public function relativePath(string $fileRealPath) : string { if (!$this->filesystem->isAbsolutePath($fileRealPath)) { return $fileRealPath; } return $this->relativeFilePathFromDirectory($fileRealPath, \getcwd()); } /** * Used from * https://github.com/phpstan/phpstan-src/blob/02425e61aa48f0668b4efb3e73d52ad544048f65/src/File/FileHelper.php#L40, with custom modifications */ public function normalizePathAndSchema(string $originalPath) : string { $directorySeparator = \DIRECTORY_SEPARATOR; $matches = Strings::match($originalPath, self::SCHEME_PATH_REGEX); if ($matches !== null) { [, $scheme, $path] = $matches; } else { $scheme = self::SCHEME_UNDEFINED; $path = $originalPath; } $normalizedPath = PathNormalizer::normalize((string) $path); $path = Strings::replace($normalizedPath, self::TWO_AND_MORE_SLASHES_REGEX, '/'); $pathRoot = \strncmp($path, '/', \strlen('/')) === 0 ? $directorySeparator : ''; $pathParts = \explode('/', \trim($path, '/')); $normalizedPathParts = $this->normalizePathParts($pathParts, $scheme); $pathStart = $scheme !== self::SCHEME_UNDEFINED ? $scheme . '://' : ''; return PathNormalizer::normalize($pathStart . $pathRoot . \implode($directorySeparator, $normalizedPathParts)); } private function relativeFilePathFromDirectory(string $fileRealPath, string $directory) : string { Assert::directory($directory); $normalizedFileRealPath = PathNormalizer::normalize($fileRealPath); $relativeFilePath = $this->filesystem->makePathRelative($normalizedFileRealPath, $directory); return \rtrim($relativeFilePath, '/'); } /** * @param string[] $pathParts * @return string[] */ private function normalizePathParts(array $pathParts, string $scheme) : array { $normalizedPathParts = []; foreach ($pathParts as $pathPart) { if ($pathPart === '.') { continue; } if ($pathPart !== '..') { $normalizedPathParts[] = $pathPart; continue; } /** @var string $removedPart */ $removedPart = \array_pop($normalizedPathParts); if ($scheme !== 'phar') { continue; } if (\substr_compare($removedPart, '.phar', -\strlen('.phar')) !== 0) { continue; } $scheme = self::SCHEME_UNDEFINED; } return $normalizedPathParts; } } PKq#4]~eeFilesFinder.phpnu[filesystemTweaker = $filesystemTweaker; $this->unchangedFilesFilter = $unchangedFilesFilter; $this->fileAndDirectoryFilter = $fileAndDirectoryFilter; $this->pathSkipper = $pathSkipper; $this->filePathHelper = $filePathHelper; $this->changedFilesDetector = $changedFilesDetector; } /** * @param string[] $source * @param string[] $suffixes * @return string[] */ public function findInDirectoriesAndFiles(array $source, array $suffixes = [], bool $sortByName = \true) : array { $filesAndDirectories = $this->filesystemTweaker->resolveWithFnmatch($source); // filtering files in files collection $filteredFilePaths = $this->fileAndDirectoryFilter->filterFiles($filesAndDirectories); $filteredFilePaths = \array_map(function (string $filePath) : string { return \realpath($filePath); }, $filteredFilePaths); $filteredFilePaths = \array_filter($filteredFilePaths, function (string $filePath) : bool { return !$this->pathSkipper->shouldSkip($filePath); }); if ($suffixes !== []) { $fileWithExtensionsFilter = static function (string $filePath) use($suffixes) : bool { $filePathExtension = \pathinfo($filePath, \PATHINFO_EXTENSION); return \in_array($filePathExtension, $suffixes, \true); }; $filteredFilePaths = \array_filter($filteredFilePaths, $fileWithExtensionsFilter); } $filteredFilePaths = \array_filter($filteredFilePaths, function (string $file) : bool { if ($this->isStartWithShortPHPTag(FileSystem::read($file))) { SimpleParameterProvider::addParameter(Option::SKIPPED_START_WITH_SHORT_OPEN_TAG_FILES, $this->filePathHelper->relativePath($file)); return \false; } return \true; }); // filtering files in directories collection $directories = $this->fileAndDirectoryFilter->filterDirectories($filesAndDirectories); $filteredFilePathsInDirectories = $this->findInDirectories($directories, $suffixes, $sortByName); $filePaths = \array_merge($filteredFilePaths, $filteredFilePathsInDirectories); return $this->unchangedFilesFilter->filterFilePaths($filePaths); } /** * @param string[] $paths * @return string[] */ public function findFilesInPaths(array $paths, Configuration $configuration) : array { if ($configuration->shouldClearCache()) { $this->changedFilesDetector->clear(); } $supportedFileExtensions = $configuration->getFileExtensions(); return $this->findInDirectoriesAndFiles($paths, $supportedFileExtensions); } /** * Exclude short "files()->size('> 0')->in($directories); if ($sortByName) { $finder->sortByName(); } if ($suffixes !== []) { $suffixesPattern = $this->normalizeSuffixesToPattern($suffixes); $finder->name($suffixesPattern); } $filePaths = []; foreach ($finder as $fileInfo) { // getRealPath() function will return false when it checks broken symlinks. // So we should check if this file exists or we got broken symlink /** @var string|false $path */ $path = $fileInfo->getRealPath(); if ($path === \false) { continue; } if ($this->pathSkipper->shouldSkip($path)) { continue; } if ($this->isStartWithShortPHPTag($fileInfo->getContents())) { SimpleParameterProvider::addParameter(Option::SKIPPED_START_WITH_SHORT_OPEN_TAG_FILES, $this->filePathHelper->relativePath($path)); continue; } $filePaths[] = $path; } return $filePaths; } /** * @param string[] $suffixes */ private function normalizeSuffixesToPattern(array $suffixes) : string { $suffixesPattern = \implode('|', $suffixes); return '#\\.(' . $suffixesPattern . ')$#'; } } PKq#4]t鰏JsonFileSystem.phpnu[PKq#4]Ő'??InitFilePathsResolver.phpnu[PKq#4]w(Y FileAndDirectoryFilter.phpnu[PKq#4]a FilesystemTweaker.phpnu[PKq#4]\  FilePathHelper.phpnu[PKq#4]~ee FilesFinder.phpnu[PK8