/** * @param Recipe $recipe * @throws RecipeNotFoundException */ public function remove(Recipe $recipe) { if (!$this->hasRecipeWithName($recipe->getName())) { throw new RecipeNotFoundException(sprintf("Recipe \"%s\" does not exists", (string) $recipe->getName())); } $this->filesystem->remove(DIRECTORY_SEPARATOR . $this->slugGenerator->generateFrom((string) $recipe->getName())); }
/** * @param $slug */ public function removeImageFor($slug) { $path = $this->generateBasePath($slug); $filePath = $this->composeJpgFilePath($slug, $path); $this->filesystem->remove($filePath); }