File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 44
55namespace Mathematicator \MandelbrotSet ;
66
7+
8+ use Nette \Utils \FileSystem ;
9+
710/**
811 * Calculate and render Mandelbrot set as image to file.
912 * Implementation is inspired by Pavol Hejny, https://www.pavolhejny.com/.
@@ -17,19 +20,11 @@ final class MandelbrotSet
1720
1821 /**
1922 * @param string $tempDir
20- * @throws \Exception
2123 */
2224 public function __construct (string $ tempDir )
2325 {
2426 ini_set ('max_execution_time ' , '100000 ' );
25-
26- if (!is_dir ($ tempDir ) && !@mkdir ($ tempDir , 0777 , true ) && !is_dir ($ tempDir )) { // @ - dir may already exist
27- throw new \Exception (
28- 'Unable to create directory " ' . $ tempDir . '". '
29- . preg_replace ('#^\w+\(.*?\): # ' , '' , error_get_last ()['message ' ])
30- );
31- }
32-
27+ FileSystem::createDir ($ tempDir );
3328 $ this ->tempDir = $ tempDir ;
3429 }
3530
You can’t perform that action at this time.
0 commit comments