1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 01:37:23 +01:00

Use flag instead of DirectoryIterator::isDot()

This commit is contained in:
Tomasz Mlynski 2021-12-14 20:00:17 +01:00
parent 832fc35d8d
commit 2c70a1a72a
No known key found for this signature in database
GPG Key ID: 665B4A17698A1954

View File

@ -1,6 +1,7 @@
<?php
namespace Psalm\Config;
use FilesystemIterator;
use Psalm\Exception\ConfigException;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
@ -186,11 +187,13 @@ class FileFilter
}
/** @var RecursiveDirectoryIterator */
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory_path));
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($directory_path, FilesystemIterator::SKIP_DOTS)
);
$iterator->rewind();
while ($iterator->valid()) {
if (!$iterator->isDot() && $iterator->isLink()) {
if ($iterator->isLink()) {
$linked_path = readlink($iterator->getPathname());
if (stripos($linked_path, $directory_path) !== 0) {