public function isFolder(Path $p) { $folderPath = $this->baseDir . $p->getPath(); if (false === file_exists($folderPath) || !is_dir($folderPath)) { return false; } return true; }