I would throw an exception here instead of triggering a PHP warning again for error reporting (the code will break anyway if the directory does not exist and the warning is not turned into an exception to interrupt the logic)