Skip to content

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

@botwetix

Description

@botwetix

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions