Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error when using chgrp() or chown() without the optional 'recursive' parameter. #1164

Open
botwetix opened this issue Jun 5, 2024 · 0 comments

Comments

@botwetix
Copy link

botwetix commented Jun 5, 2024

Steps to reproduce

Use the FilesystemStack object's chgrp() or chown() method without the optional 3rd parameter (recursive)

   $this->taskFilesystemStack()
      ->chgrp('www', 'www-data')
      ->run();

Expected behavior

Change of group or owner should be performed on the element without recursion.

Actual behavior

PHP Fatal error:  Uncaught TypeError: Symfony\Component\Filesystem\Filesystem::chgrp(): Argument #3 ($recursive) must be of type bool, null given, called in /tmp/test/vendor/consolidation/robo/src/Task/Filesystem/FilesystemStack.php

System Configuration

PHP 8.1
Symfony 6.4.8

Origin

In /src/Task/Filesystem/FilesystemStack.php, in the signature of the _chgrp() and _chown() methods, the default value of the $recursive parameter should be FALSE (null given).

    protected function _chgrp($file, $group, $recursive = null)
[...]
    protected function _chown($file, $user, $recursive = null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant