private appendPathAndFilterExisting ( array $references, string $nestedPath, integer $flags ) : string[] | ||
$references | array | The references. |
$nestedPath | string | The nested path to append without leading slash ("/"). |
$flags | integer | A bitwise combination of the flag constants in this class. |
Результат | string[] | The references with the nested path appended. Each reference is guaranteed to exist on the filesystem. |
private function appendPathAndFilterExisting(array $references, $nestedPath, $flags = 0)
{
$result = array();
foreach ($references as $reference) {
// Filter out null values
// Links should be followed before calling this method
if (null === $reference) {
continue;
}
$nestedReference = rtrim($reference, '/') . '/' . $nestedPath;
if (file_exists($nestedReference)) {
$result[] = $nestedReference;
if ($flags & self::STOP_ON_FIRST) {
return $result;
}
}
}
return $result;
}