class Filesystem
Same name in this branch
- 11.1.x vendor/phpunit/php-code-coverage/src/Util/Filesystem.php \SebastianBergmann\CodeCoverage\Util\Filesystem
- 11.1.x vendor/php-tuf/composer-stager/src/Internal/Filesystem/Service/Filesystem.php \PhpTuf\ComposerStager\Internal\Filesystem\Service\Filesystem
- 11.1.x vendor/composer/composer/src/Composer/Util/Filesystem.php \Composer\Util\Filesystem
- 11.1.x vendor/symfony/filesystem/Filesystem.php \Symfony\Component\Filesystem\Filesystem
- 11.1.x core/lib/Drupal/Core/File/FileSystem.php \Drupal\Core\File\FileSystem
- 11.1.x core/lib/Drupal/Component/FileSystem/FileSystem.php \Drupal\Component\FileSystem\FileSystem
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
@internal This class is not covered by the backward compatibility promise for PHPUnit
Hierarchy
- class \PHPUnit\Util\Filesystem
Expanded class hierarchy of Filesystem
4 files declare their use of Filesystem
- Builder.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Cli/ Builder.php - DefaultPrinter.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Printer/ DefaultPrinter.php - DefaultResultCache.php in vendor/
phpunit/ phpunit/ src/ Runner/ ResultCache/ DefaultResultCache.php - Merger.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Merger.php
2 string references to 'Filesystem'
- RepositoryFactory::configFromString in vendor/
composer/ composer/ src/ Composer/ Repository/ RepositoryFactory.php - RepositoryFactory::createRepos in vendor/
composer/ composer/ src/ Composer/ Repository/ RepositoryFactory.php
File
-
vendor/
phpunit/ phpunit/ src/ Util/ Filesystem.php, line 25
Namespace
PHPUnit\UtilView source
final class Filesystem {
public static function createDirectory(string $directory) : bool {
return !(!is_dir($directory) && !@mkdir($directory, 0777, true) && !is_dir($directory));
}
/**
* @psalm-param non-empty-string $path
*
* @return false|non-empty-string
*/
public static function resolveStreamOrFile(string $path) : false|string {
if (str_starts_with($path, 'php://') || str_starts_with($path, 'socket://')) {
return $path;
}
$directory = dirname($path);
if (is_dir($directory)) {
return realpath($directory) . DIRECTORY_SEPARATOR . basename($path);
}
return false;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
Filesystem::createDirectory | public static | function | |
Filesystem::resolveStreamOrFile | public static | function | @psalm-param non-empty-string $path |