10
10
namespace SebastianBergmann \CodeCoverage \Report \Html ;
11
11
12
12
use SebastianBergmann \CodeCoverage \CodeCoverage ;
13
+ use SebastianBergmann \CodeCoverage \Directory as DirectoryUtil ;
13
14
use SebastianBergmann \CodeCoverage \Node \Directory as DirectoryNode ;
14
15
use SebastianBergmann \CodeCoverage \RuntimeException ;
15
16
@@ -89,7 +90,7 @@ public function process(CodeCoverage $coverage, string $target): void
89
90
$ id = $ node ->getId ();
90
91
91
92
if ($ node instanceof DirectoryNode) {
92
- if (!$ this -> createDirectory ($ target . $ id )) {
93
+ if (!DirectoryUtil:: create ($ target . $ id )) {
93
94
throw new \RuntimeException (\sprintf ('Directory "%s" was not created ' , $ target . $ id ));
94
95
}
95
96
@@ -98,7 +99,7 @@ public function process(CodeCoverage $coverage, string $target): void
98
99
} else {
99
100
$ dir = \dirname ($ target . $ id );
100
101
101
- if (!$ this -> createDirectory ($ dir )) {
102
+ if (!DirectoryUtil:: create ($ dir )) {
102
103
throw new \RuntimeException (\sprintf ('Directory "%s" was not created ' , $ dir ));
103
104
}
104
105
@@ -144,7 +145,7 @@ private function getDirectory(string $directory): string
144
145
$ directory .= \DIRECTORY_SEPARATOR ;
145
146
}
146
147
147
- if (!$ this -> createDirectory ($ directory )) {
148
+ if (!DirectoryUtil:: create ($ directory )) {
148
149
throw new RuntimeException (
149
150
\sprintf (
150
151
'Directory "%s" does not exist. ' ,
@@ -155,9 +156,4 @@ private function getDirectory(string $directory): string
155
156
156
157
return $ directory ;
157
158
}
158
-
159
- private function createDirectory (string $ directory ): bool
160
- {
161
- return !(!\is_dir ($ directory ) && !@\mkdir ($ directory , 0777 , true ) && !\is_dir ($ directory ));
162
- }
163
159
}
0 commit comments