?????????? ????????? - ??????????????? - /home/agenciai/public_html/cd38d8/Skipper.zip
???????
PK ;%\�(�$ $ SkipSkipper.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\Skipper; use Rector\Skipper\Matcher\FileInfoMatcher; final class SkipSkipper { /** * @readonly * @var \Rector\Skipper\Matcher\FileInfoMatcher */ private $fileInfoMatcher; public function __construct(FileInfoMatcher $fileInfoMatcher) { $this->fileInfoMatcher = $fileInfoMatcher; } /** * @param array<string, string[]|null> $skippedClasses * @param object|string $checker */ public function doesMatchSkip($checker, string $filePath, array $skippedClasses) : bool { foreach ($skippedClasses as $skippedClass => $skippedFiles) { if (!\is_a($checker, $skippedClass, \true)) { continue; } // skip everywhere if (!\is_array($skippedFiles)) { return \true; } if ($this->fileInfoMatcher->doesFileInfoMatchPatterns($filePath, $skippedFiles)) { return \true; } } return \false; } } PK ;%\SFw6� � Skipper.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\Skipper; use PhpParser\Node; use Rector\Contract\Rector\RectorInterface; use Rector\ProcessAnalyzer\RectifiedAnalyzer; use Rector\Skipper\SkipVoter\ClassSkipVoter; /** * @api * @see \Rector\Tests\Skipper\Skipper\SkipperTest */ final class Skipper { /** * @readonly * @var \Rector\ProcessAnalyzer\RectifiedAnalyzer */ private $rectifiedAnalyzer; /** * @readonly * @var \Rector\Skipper\Skipper\PathSkipper */ private $pathSkipper; /** * @readonly * @var \Rector\Skipper\SkipVoter\ClassSkipVoter */ private $classSkipVoter; public function __construct(RectifiedAnalyzer $rectifiedAnalyzer, \Rector\Skipper\Skipper\PathSkipper $pathSkipper, ClassSkipVoter $classSkipVoter) { $this->rectifiedAnalyzer = $rectifiedAnalyzer; $this->pathSkipper = $pathSkipper; $this->classSkipVoter = $classSkipVoter; } /** * @param string|object $element */ public function shouldSkipElement($element) : bool { return $this->shouldSkipElementAndFilePath($element, __FILE__); } public function shouldSkipFilePath(string $filePath) : bool { return $this->pathSkipper->shouldSkip($filePath); } /** * @param string|object $element */ public function shouldSkipElementAndFilePath($element, string $filePath) : bool { if (!$this->classSkipVoter->match($element)) { return \false; } return $this->classSkipVoter->shouldSkip($element, $filePath); } /** * @param class-string<RectorInterface> $rectorClass * @param string|object $element */ public function shouldSkipCurrentNode($element, string $filePath, string $rectorClass, Node $node) : bool { if ($this->shouldSkipElementAndFilePath($element, $filePath)) { return \true; } return $this->rectifiedAnalyzer->hasRectified($rectorClass, $node); } } PK ;%\f2/� � PathSkipper.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\Skipper; use Rector\Skipper\Matcher\FileInfoMatcher; use Rector\Skipper\SkipCriteriaResolver\SkippedPathsResolver; final class PathSkipper { /** * @readonly * @var \Rector\Skipper\Matcher\FileInfoMatcher */ private $fileInfoMatcher; /** * @readonly * @var \Rector\Skipper\SkipCriteriaResolver\SkippedPathsResolver */ private $skippedPathsResolver; public function __construct(FileInfoMatcher $fileInfoMatcher, SkippedPathsResolver $skippedPathsResolver) { $this->fileInfoMatcher = $fileInfoMatcher; $this->skippedPathsResolver = $skippedPathsResolver; } public function shouldSkip(string $filePath) : bool { $skippedPaths = $this->skippedPathsResolver->resolve(); return $this->fileInfoMatcher->doesFileInfoMatchPatterns($filePath, $skippedPaths); } } PK =%\Հn� � - SkipCriteriaResolver/SkippedClassResolver.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\SkipCriteriaResolver; use Rector\Configuration\Option; use Rector\Configuration\Parameter\SimpleParameterProvider; use Rector\Testing\PHPUnit\StaticPHPUnitEnvironment; final class SkippedClassResolver { /** * @var null|array<string, string[]|null> */ private $skippedClasses = null; /** * @return array<string, string[]|null> */ public function resolve() : array { // disable cache in tests if (StaticPHPUnitEnvironment::isPHPUnitRun()) { $this->skippedClasses = null; } // already cached, even only empty array if ($this->skippedClasses !== null) { return $this->skippedClasses; } $skip = SimpleParameterProvider::provideArrayParameter(Option::SKIP); $this->skippedClasses = []; foreach ($skip as $key => $value) { // e.g. [SomeClass::class] → shift values to [SomeClass::class => null] if (\is_int($key)) { $key = $value; $value = null; } if (!\is_string($key)) { continue; } // this only checks for Rector rules, that are always autoloaded if (!\class_exists($key) && !\interface_exists($key)) { continue; } $this->skippedClasses[$key] = $value; } return $this->skippedClasses; } } PK =%\�]�� � - SkipCriteriaResolver/SkippedPathsResolver.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\SkipCriteriaResolver; use Rector\Configuration\Option; use Rector\Configuration\Parameter\SimpleParameterProvider; use Rector\FileSystem\FilePathHelper; use Rector\Testing\PHPUnit\StaticPHPUnitEnvironment; /** * @see \Rector\Tests\Skipper\SkipCriteriaResolver\SkippedPathsResolver\SkippedPathsResolverTest */ final class SkippedPathsResolver { /** * @readonly * @var \Rector\FileSystem\FilePathHelper */ private $filePathHelper; /** * @var null|string[] */ private $skippedPaths = null; public function __construct(FilePathHelper $filePathHelper) { $this->filePathHelper = $filePathHelper; } /** * @return string[] */ public function resolve() : array { // disable cache in tests if (StaticPHPUnitEnvironment::isPHPUnitRun()) { $this->skippedPaths = null; } // already cached, even only empty array if ($this->skippedPaths !== null) { return $this->skippedPaths; } $skip = SimpleParameterProvider::provideArrayParameter(Option::SKIP); $this->skippedPaths = []; foreach ($skip as $key => $value) { if (!\is_int($key)) { continue; } if (\strpos((string) $value, '*') !== \false) { $this->skippedPaths[] = $this->filePathHelper->normalizePathAndSchema($value); continue; } if (\file_exists($value)) { $this->skippedPaths[] = $this->filePathHelper->normalizePathAndSchema($value); } } return $this->skippedPaths; } } PK =%\<��$� � $ FileSystem/FnMatchPathNormalizer.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\FileSystem; /** * @see \Rector\Tests\Skipper\FileSystem\FnMatchPathNormalizerTest */ final class FnMatchPathNormalizer { public function normalizeForFnmatch(string $path) : string { if (\substr_compare($path, '*', -\strlen('*')) === 0 || \strncmp($path, '*', \strlen('*')) === 0) { return '*' . \trim($path, '*') . '*'; } if (\strpos($path, '..') !== \false) { /** @var string|false $realPath */ $realPath = \realpath($path); if ($realPath === \false) { return ''; } return \Rector\Skipper\FileSystem\PathNormalizer::normalize($realPath); } return $path; } } PK =%\�2g� � FileSystem/PathNormalizer.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\FileSystem; final class PathNormalizer { public static function normalize(string $path) : string { return \str_replace('\\', '/', $path); } } PK =%\�&��� � RealpathMatcher.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper; use Rector\Skipper\FileSystem\PathNormalizer; final class RealpathMatcher { public function match(string $matchingPath, string $filePath) : bool { /** @var string|false $realPathMatchingPath */ $realPathMatchingPath = \realpath($matchingPath); if ($realPathMatchingPath === \false) { return \false; } /** @var string|false $realpathFilePath */ $realpathFilePath = \realpath($filePath); if ($realpathFilePath === \false) { return \false; } $normalizedMatchingPath = PathNormalizer::normalize($realPathMatchingPath); $normalizedFilePath = PathNormalizer::normalize($realpathFilePath); // skip define direct path if (\is_file($normalizedMatchingPath)) { return $normalizedMatchingPath === $normalizedFilePath; } // ensure add / suffix to ensure no same prefix directory if (\is_dir($normalizedMatchingPath)) { $normalizedMatchingPath = \rtrim($normalizedMatchingPath, '/') . '/'; } return \strncmp($normalizedFilePath, $normalizedMatchingPath, \strlen($normalizedMatchingPath)) === 0; } } PK =%\|0s� � Matcher/FileInfoMatcher.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\Matcher; use Rector\Skipper\FileSystem\FnMatchPathNormalizer; use Rector\Skipper\FileSystem\PathNormalizer; use Rector\Skipper\Fnmatcher; use Rector\Skipper\RealpathMatcher; final class FileInfoMatcher { /** * @readonly * @var \Rector\Skipper\FileSystem\FnMatchPathNormalizer */ private $fnMatchPathNormalizer; /** * @readonly * @var \Rector\Skipper\Fnmatcher */ private $fnmatcher; /** * @readonly * @var \Rector\Skipper\RealpathMatcher */ private $realpathMatcher; public function __construct(FnMatchPathNormalizer $fnMatchPathNormalizer, Fnmatcher $fnmatcher, RealpathMatcher $realpathMatcher) { $this->fnMatchPathNormalizer = $fnMatchPathNormalizer; $this->fnmatcher = $fnmatcher; $this->realpathMatcher = $realpathMatcher; } /** * @param string[] $filePatterns */ public function doesFileInfoMatchPatterns(string $filePath, array $filePatterns) : bool { $filePath = PathNormalizer::normalize($filePath); foreach ($filePatterns as $filePattern) { $filePattern = PathNormalizer::normalize($filePattern); if ($this->doesFileMatchPattern($filePath, $filePattern)) { return \true; } } return \false; } /** * Supports both relative and absolute $file path. They differ for PHP-CS-Fixer and PHP_CodeSniffer. */ private function doesFileMatchPattern(string $filePath, string $ignoredPath) : bool { // in rector.php, the path can be absolute if ($filePath === $ignoredPath) { return \true; } $ignoredPath = $this->fnMatchPathNormalizer->normalizeForFnmatch($ignoredPath); if ($ignoredPath === '') { return \false; } if (\strncmp($filePath, $ignoredPath, \strlen($ignoredPath)) === 0) { return \true; } if (\substr_compare($filePath, $ignoredPath, -\strlen($ignoredPath)) === 0) { return \true; } if ($this->fnmatcher->match($ignoredPath, $filePath)) { return \true; } return $this->realpathMatcher->match($ignoredPath, $filePath); } } PK =%\�*#� � SkipVoter/ClassSkipVoter.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\SkipVoter; use PHPStan\Reflection\ReflectionProvider; use Rector\Skipper\SkipCriteriaResolver\SkippedClassResolver; use Rector\Skipper\Skipper\SkipSkipper; final class ClassSkipVoter { /** * @readonly * @var \Rector\Skipper\Skipper\SkipSkipper */ private $skipSkipper; /** * @readonly * @var \Rector\Skipper\SkipCriteriaResolver\SkippedClassResolver */ private $skippedClassResolver; /** * @readonly * @var \PHPStan\Reflection\ReflectionProvider */ private $reflectionProvider; public function __construct(SkipSkipper $skipSkipper, SkippedClassResolver $skippedClassResolver, ReflectionProvider $reflectionProvider) { $this->skipSkipper = $skipSkipper; $this->skippedClassResolver = $skippedClassResolver; $this->reflectionProvider = $reflectionProvider; } /** * @param string|object $element */ public function match($element) : bool { if (\is_object($element)) { return \true; } return $this->reflectionProvider->hasClass($element); } /** * @param string|object $element */ public function shouldSkip($element, string $filePath) : bool { $skippedClasses = $this->skippedClassResolver->resolve(); return $this->skipSkipper->doesMatchSkip($element, $filePath, $skippedClasses); } } PK =%\�(�$ $ Skipper/SkipSkipper.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\Skipper; use Rector\Skipper\Matcher\FileInfoMatcher; final class SkipSkipper { /** * @readonly * @var \Rector\Skipper\Matcher\FileInfoMatcher */ private $fileInfoMatcher; public function __construct(FileInfoMatcher $fileInfoMatcher) { $this->fileInfoMatcher = $fileInfoMatcher; } /** * @param array<string, string[]|null> $skippedClasses * @param object|string $checker */ public function doesMatchSkip($checker, string $filePath, array $skippedClasses) : bool { foreach ($skippedClasses as $skippedClass => $skippedFiles) { if (!\is_a($checker, $skippedClass, \true)) { continue; } // skip everywhere if (!\is_array($skippedFiles)) { return \true; } if ($this->fileInfoMatcher->doesFileInfoMatchPatterns($filePath, $skippedFiles)) { return \true; } } return \false; } } PK =%\SFw6� � Skipper/Skipper.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\Skipper; use PhpParser\Node; use Rector\Contract\Rector\RectorInterface; use Rector\ProcessAnalyzer\RectifiedAnalyzer; use Rector\Skipper\SkipVoter\ClassSkipVoter; /** * @api * @see \Rector\Tests\Skipper\Skipper\SkipperTest */ final class Skipper { /** * @readonly * @var \Rector\ProcessAnalyzer\RectifiedAnalyzer */ private $rectifiedAnalyzer; /** * @readonly * @var \Rector\Skipper\Skipper\PathSkipper */ private $pathSkipper; /** * @readonly * @var \Rector\Skipper\SkipVoter\ClassSkipVoter */ private $classSkipVoter; public function __construct(RectifiedAnalyzer $rectifiedAnalyzer, \Rector\Skipper\Skipper\PathSkipper $pathSkipper, ClassSkipVoter $classSkipVoter) { $this->rectifiedAnalyzer = $rectifiedAnalyzer; $this->pathSkipper = $pathSkipper; $this->classSkipVoter = $classSkipVoter; } /** * @param string|object $element */ public function shouldSkipElement($element) : bool { return $this->shouldSkipElementAndFilePath($element, __FILE__); } public function shouldSkipFilePath(string $filePath) : bool { return $this->pathSkipper->shouldSkip($filePath); } /** * @param string|object $element */ public function shouldSkipElementAndFilePath($element, string $filePath) : bool { if (!$this->classSkipVoter->match($element)) { return \false; } return $this->classSkipVoter->shouldSkip($element, $filePath); } /** * @param class-string<RectorInterface> $rectorClass * @param string|object $element */ public function shouldSkipCurrentNode($element, string $filePath, string $rectorClass, Node $node) : bool { if ($this->shouldSkipElementAndFilePath($element, $filePath)) { return \true; } return $this->rectifiedAnalyzer->hasRectified($rectorClass, $node); } } PK =%\f2/� � Skipper/PathSkipper.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper\Skipper; use Rector\Skipper\Matcher\FileInfoMatcher; use Rector\Skipper\SkipCriteriaResolver\SkippedPathsResolver; final class PathSkipper { /** * @readonly * @var \Rector\Skipper\Matcher\FileInfoMatcher */ private $fileInfoMatcher; /** * @readonly * @var \Rector\Skipper\SkipCriteriaResolver\SkippedPathsResolver */ private $skippedPathsResolver; public function __construct(FileInfoMatcher $fileInfoMatcher, SkippedPathsResolver $skippedPathsResolver) { $this->fileInfoMatcher = $fileInfoMatcher; $this->skippedPathsResolver = $skippedPathsResolver; } public function shouldSkip(string $filePath) : bool { $skippedPaths = $this->skippedPathsResolver->resolve(); return $this->fileInfoMatcher->doesFileInfoMatchPatterns($filePath, $skippedPaths); } } PK =%\Ml�Wb b Fnmatcher.phpnu �[��� <?php declare (strict_types=1); namespace Rector\Skipper; final class Fnmatcher { public function match(string $matchingPath, string $filePath) : bool { if (\fnmatch($matchingPath, $filePath)) { return \true; } // in case of relative compare return \fnmatch('*/' . $matchingPath, $filePath); } } PK ;%\�(�$ $ SkipSkipper.phpnu �[��� PK ;%\SFw6� � c Skipper.phpnu �[��� PK ;%\f2/� � � PathSkipper.phpnu �[��� PK =%\Հn� � - Q SkipCriteriaResolver/SkippedClassResolver.phpnu �[��� PK =%\�]�� � - p SkipCriteriaResolver/SkippedPathsResolver.phpnu �[��� PK =%\<��$� � $ z FileSystem/FnMatchPathNormalizer.phpnu �[��� PK =%\�2g� � � FileSystem/PathNormalizer.phpnu �[��� PK =%\�&��� � �! RealpathMatcher.phpnu �[��� PK =%\|0s� � '