REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.56 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/src/FileSystem/InitFilePathsResolver.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\FileSystem; use RectorPrefix202411\Symfony\Component\Finder\Finder; use RectorPrefix202411\Symfony\Component\Finder\SplFileInfo; /** * @see \Rector\Tests\FileSystem\InitFilePathsResolver\InitFilePathsResolverTest */ final class InitFilePathsResolver { /** * @var string * @see https://regex101.com/r/XkQ6Pe/1 */ private const DO_NOT_INCLUDE_PATHS_REGEX = '#(vendor|var|stubs|temp|templates|tmp|e2e|bin|build|Migrations|data(?:base)?|storage|migrations|writable)#'; /** * @return string[] */ public function resolve(string $projectDirectory) : array { $rootDirectoryFinder = Finder::create()->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; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
FileAndDirectoryFilter.php
958 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FilePathHelper.php
3.51 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FilesFinder.php
6.10 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FilesystemTweaker.php
1.03 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
InitFilePathsResolver.php
1.56 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
JsonFileSystem.php
655 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).