private function getTargetDirectory(PackageInterface $package) { if (!is_dir($this->vendorDirectory)) { if (file_exists($this->vendorDirectory)) { throw new RuntimeException($this->vendorDirectory . ' exists and is not a directory.'); } if (!@mkdir($this->vendorDirectory, 0777, true)) { throw new RuntimeException($this->vendorDirectory . ' does not exist and could not be created.'); } } $targetDirectory = $this->vendorDirectory . DIRECTORY_SEPARATOR . $package->getName(); FileSystem::createDirectory($targetDirectory); return $targetDirectory; }