File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -80,20 +80,22 @@ public function getEnvironmentVariables()
8080
8181
8282 /**
83- * @param string
83+ * @param string|null
8484 */
8585 public function setTempDirectory ($ path )
8686 {
87- if (!is_dir ($ path ) || !is_writable ($ path )) {
88- throw new \RuntimeException ("Path ' $ path' is not a writable directory. " );
89- }
87+ if ($ path !== null ) {
88+ if (!is_dir ($ path ) || !is_writable ($ path )) {
89+ throw new \RuntimeException ("Path ' $ path' is not a writable directory. " );
90+ }
9091
91- $ tempDir = realpath ($ path ) . DIRECTORY_SEPARATOR . 'Tester ' ;
92- if (!is_dir ($ tempDir ) && @mkdir ($ tempDir ) === false && !is_dir ($ tempDir )) { // @ - directory may exist
93- throw new \RuntimeException ("Cannot create ' $ tempDir' directory. " );
92+ $ path = realpath ($ path ) . DIRECTORY_SEPARATOR . 'Tester ' ;
93+ if (!is_dir ($ path ) && @mkdir ($ path ) === false && !is_dir ($ path )) { // @ - directory may exist
94+ throw new \RuntimeException ("Cannot create ' $ path' directory. " );
95+ }
9496 }
9597
96- $ this ->tempDir = $ tempDir ;
98+ $ this ->tempDir = $ path ;
9799 }
98100
99101
You can’t perform that action at this time.
0 commit comments