minor #37910 [Filesystem] fix test on PHP 8 (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[Filesystem] fix test on PHP 8

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

c08178978a [Filesystem] fix test on PHP 8
This commit is contained in:
Fabien Potencier 2020-08-21 15:37:43 +02:00
commit 12706c4ff0

View File

@ -198,7 +198,7 @@ class Filesystem
public function chmod($files, $mode, $umask = 0000, $recursive = false)
{
foreach ($this->toIterable($files) as $file) {
if (true !== @chmod($file, $mode & ~$umask)) {
if ((\PHP_VERSION_ID < 80000 || \is_int($mode)) && true !== @chmod($file, $mode & ~$umask)) {
throw new IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file);
}
if ($recursive && is_dir($file) && !is_link($file)) {