8000 [Filesystem] Fix str_contains deprecation · symfony/symfony@8003acc · GitHub
[go: up one dir, main page]

Skip to content

Commit 8003acc

Browse files
committed
[Filesystem] Fix str_contains deprecation
1 parent 3fbca7b commit 8003acc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private static function doRemove(array $files, bool $isRecursive): void
199199

200200
throw new IOException(sprintf('Failed to remove directory "%s": ', $file).$lastError);
201201
}
202-
} elseif (!self::box('unlink', $file) && (str_contains(self::$lastError, 'Permission denied') || file_exists($file))) {
202+
} elseif (!self::box('unlink', $file) && (str_contains((string) self::$lastError, 'Permission denied') || file_exists($file))) {
203203
throw new IOException(sprintf('Failed to remove file "%s": ', $file).self::$lastError);
204204
}
205205
}
@@ -396,7 +396,7 @@ public function hardlink(string $originFile, $targetFiles)
396396
private function linkException(string $origin, string $target, string $linkType)
397397
{
398398
if (self::$lastError) {
399-
if ('\\' === \DIRECTORY_SEPARATOR && str_contains(self::$lastError, 'error code(1314)')) {
399+
if ('\\' === \DIRECTORY_SEPARATOR && str_contains((string) self::$lastError, 'error code(1314)')) {
400400
throw new IOException(sprintf('Unable to create "%s" link due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?', $linkType), 0, null, $target);
401401
}
402402
}

0 commit comments

Comments
 (0)
0