$this->fileSystem in this case is \Symfony\Component\Filesystem\Filesystem and it doesn't have realPath() method. Maybe you are thinking of \Drupal\Core\File\FileSystem::realpath but we don't have that service here. We are using just realpath() in multiple places.
I'd rather we used
$this->fileSystem->realpath()
for this. Otherwise, no objections.$this->fileSystem
in this case is\Symfony\Component\Filesystem\Filesystem
and it doesn't haverealPath()
method. Maybe you are thinking of\Drupal\Core\File\FileSystem::realpath
but we don't have that service here. We are using justrealpath()
in multiple places.