File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -27,4 +27,9 @@ public static function classNameToFilename(string $className): string
27
27
$ className
28
28
) . '.php ' ;
29
29
}
30
+
31
+ public static function createDirectory (string $ directory ): bool
32
+ {
33
+ return !(!\is_dir ($ directory ) && !@\mkdir ($ directory , 0777 , true ) && !\is_dir ($ directory ));
34
+ }
30
35
}
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function __construct($out = null)
53
53
54
54
$ this ->out = \fsockopen ($ out [0 ], $ out [1 ]);
55
55
} else {
56
- if (\strpos ($ out , 'php:// ' ) === false && !$ this -> createDirectory (\dirname ($ out ))) {
56
+ if (\strpos ($ out , 'php:// ' ) === false && !Filesystem:: createDirectory (\dirname ($ out ))) {
57
57
throw new Exception (\sprintf ('Directory "%s" was not created ' , \dirname ($ out )));
58
58
}
59
59
@@ -132,9 +132,4 @@ public function setAutoFlush(bool $autoFlush): void
132
132
{
133
133
$ this ->autoFlush = $ autoFlush ;
134
134
}
135
-
136
- private function createDirectory (string $ directory ): bool
137
- {
138
- return !(!\is_dir ($ directory ) && !@\mkdir ($ directory , 0777 , true ) && !\is_dir ($ directory ));
139
- }
140
135
}
Original file line number Diff line number Diff line change 10
10
namespace PHPUnit \Runner ;
11
11
12
12
use PHPUnit \Framework \Test ;
13
+ use PHPUnit \Util \Filesystem ;
13
14
14
15
class TestResultCache implements \Serializable, TestResultCacheInterface
15
16
{
@@ -79,7 +80,7 @@ public function saveToFile(): void
79
80
return ;
80
81
}
81
82
82
- if (!$ this -> createDirectory (\dirname ($ this ->cacheFilename ))) {
83
+ if (!Filesystem:: createDirectory (\dirname ($ this ->cacheFilename ))) {
83
84
throw new Exception (
84
85
\sprintf (
85
86
'Cannot create directory "%s" for result cache file ' ,
@@ -187,9 +188,4 @@ public function unserialize($serialized): void
187
188
}
188
189
}
189
190
}
190
-
191
- private function createDirectory (string $ directory ): bool
192
- {
193
- return !(!\is_dir ($ directory ) && !@\mkdir ($ directory , 0777 , true ) && !\is_dir ($ directory ));
194
- }
195
191
}
You can’t perform that action at this time.
0 commit comments