Fixed the tmp dir creation bug and updated some docs. Review: #53311.
Removed a var_dump.
Changed the temp dir existance check. Review: #53311.
Made a misverstandje in the realpath check, fixed it! Review: #53311.
Added a warning surpression '@' to the tmp dir creation as we already handle the error.
Removed an unused param.