File tree 2 files changed +6
-6
lines changed
src/Symfony/Component/Filesystem
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -156,9 +156,9 @@ public function remove($files)
156
156
$ error = error_get_last ();
157
157
throw new IOException (sprintf ('Failed to remove directory "%s": %s. ' , $ file , $ error ['message ' ]));
158
158
}
159
- } elseif ($ this -> exists ($ file )) {
160
- if (!@ unlink ( $ file )) {
161
- $ error = error_get_last ();
159
+ } elseif (!@ unlink ($ file )) {
160
+ $ error = error_get_last ();
161
+ if ( file_exists ( $ file )) {
162
162
throw new IOException (sprintf ('Failed to remove file "%s": %s. ' , $ file , $ error ['message ' ]));
163
163
}
164
164
}
Original file line number Diff line number Diff line change @@ -38,8 +38,7 @@ public static function setUpBeforeClass()
38
38
if ('\\' === DIRECTORY_SEPARATOR && null === self ::$ symlinkOnWindows ) {
39
39
$ target = tempnam (sys_get_temp_dir (), 'sl ' );
40
40
$ link = sys_get_temp_dir ().'/sl ' .microtime (true ).mt_rand ();
41
- if (@symlink ($ target , $ link )) {
42
- self ::$ symlinkOnWindows = @is_link ($ link );
41
+ if (self ::$ symlinkOnWindows = @symlink ($ target , $ link )) {
43
42
unlink ($ link );
44
43
}
45
44
unlink ($ target );
@@ -61,6 +60,7 @@ protected function tearDown()
61
60
foreach ($ this ->longPathNamesWindows as $ path ) {
62
61
exec ('DEL ' .$ path );
63
62
}
63
+ $ this ->longPathNamesWindows = array ();
64
64
}
65
65
66
66
$ this ->filesystem ->remove ($ this ->workspace );
@@ -1089,7 +1089,7 @@ private function markAsSkippedIfChmodIsMissing()
1089
1089
1090
1090
private function markAsSkippedIfPosixIsMissing ()
1091
1091
{
1092
- if ('\\' === DIRECTORY_SEPARATOR || !function_exists ('posix_isatty ' )) {
1092
+ if (!function_exists ('posix_isatty ' )) {
1093
1093
$ this ->markTestSkipped ('POSIX is not supported ' );
1094
1094
}
1095
1095
}
You can’t perform that action at this time.
0 commit comments