1010namespace SebastianBergmann \CodeCoverage \Report \Html ;
1111
1212use SebastianBergmann \CodeCoverage \CodeCoverage ;
13+ use SebastianBergmann \CodeCoverage \Directory as DirectoryUtil ;
1314use SebastianBergmann \CodeCoverage \Node \Directory as DirectoryNode ;
1415use SebastianBergmann \CodeCoverage \RuntimeException ;
1516
@@ -89,7 +90,7 @@ public function process(CodeCoverage $coverage, string $target): void
8990 $ id = $ node ->getId ();
9091
9192 if ($ node instanceof DirectoryNode) {
92- if (!$ this -> createDirectory ($ target . $ id )) {
93+ if (!DirectoryUtil:: create ($ target . $ id )) {
9394 throw new \RuntimeException (\sprintf ('Directory "%s" was not created ' , $ target . $ id ));
9495 }
9596
@@ -98,7 +99,7 @@ public function process(CodeCoverage $coverage, string $target): void
9899 } else {
99100 $ dir = \dirname ($ target . $ id );
100101
101- if (!$ this -> createDirectory ($ dir )) {
102+ if (!DirectoryUtil:: create ($ dir )) {
102103 throw new \RuntimeException (\sprintf ('Directory "%s" was not created ' , $ dir ));
103104 }
104105
@@ -144,7 +145,7 @@ private function getDirectory(string $directory): string
144145 $ directory .= \DIRECTORY_SEPARATOR ;
145146 }
146147
147- if (!$ this -> createDirectory ($ directory )) {
148+ if (!DirectoryUtil:: create ($ directory )) {
148149 throw new RuntimeException (
149150 \sprintf (
150151 'Directory "%s" does not exist. ' ,
@@ -155,9 +156,4 @@ private function getDirectory(string $directory): string
155156
156157 return $ directory ;
157158 }
158-
159- private function createDirectory (string $ directory ): bool
160- {
161- return !(!\is_dir ($ directory ) && !@\mkdir ($ directory , 0777 , true ) && !\is_dir ($ directory ));
162- }
163159}
0 commit comments