Skip to content

Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Process\Process::__construct() must be of the type array, string given, #138

Description

@s2925534

While trying to use the pre-push hook and I just do a git push origin I get the following issue

john.doe@C02CF02MLVDM code-standards-addons % git push origin dev-hooks Pre-push hook PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Process\Process::__construct() must be of the type array, string given, called in /Users/pedro/projects/Swissport/code-standards-addons/vendor/bruli/php-git-hooks/src/PhpGitHooks/Module/Git/Infrastructure/Git/PrePushOriginalExecutor.php on line 18 and defined in /Users/pedro/projects/Swissport/code-standards-addons/vendor/symfony/process/Process.php:140 Stack trace: #0 /Users/pedro/projects/Swissport/code-standards-addons/vendor/bruli/php-git-hooks/src/PhpGitHooks/Module/Git/Infrastructure/Git/PrePushOriginalExecutor.php(18): Symfony\Component\Process\Process->__construct('./pre-push-orig...') #1 /Users/pedro/projects/Swissport/code-standards-addons/vendor/bruli/php-git-hooks/src/PhpGitHooks/Module/Git/Contract/Command/PrePushToolHandler.php(120): PhpGitHooks\Module\Git\Infrastructure\Git\PrePushOriginalExecutor->execute('origin', 'git@bitbucket.o...') #2 /Users/pedro/projects/Swissport/code-standards-addons/vendor/bruli/php-git-hooks/src/PhpGitHooks/ in /Users/pedro/projects/Swissport/code-standards-addons/vendor/symfony/process/Process.php on line 140 `` Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Process\Process::__construct() must be of the type array, string given, called in /Users/pedro/projects/Swissport/code-standards-addons/vendor/bruli/php-git-hooks/src/PhpGitHooks/Module/Git/Infrastructure/Git/PrePushOriginalExecutor.php on line 18 and defined in /Users/pedro/projects/Swissport/code-standards-addons/vendor/symfony/process/Process.php:140 Stack trace: #0 /Users/pedro/projects/Swissport/code-standards-addons/vendor/bruli/php-git-hooks/src/PhpGitHooks/Module/Git/Infrastructure/Git/PrePushOriginalExecutor.php(18): Symfony\Component\Process\Process->__construct('./pre-push-orig...') #1 /Users/pedro/projects/Swissport/code-standards-addons/vendor/bruli/php-git-hooks/src/PhpGitHooks/Module/Git/Contract/Command/PrePushToolHandler.php(120): PhpGitHooks\Module\Git\Infrastructure\Git\PrePushOriginalExecutor->execute('origin', 'git@bitbucket.o...') #2 /Users/pedro/projects/Swissport/code-standards-addons/vendor/bruli/php-git-hooks/src/PhpGitHooks/ in /Users/pedro/projects/Swissport/code-standards-addons/vendor/symfony/process/Process.php on line 140 error: failed to push some refs to 'git@bitbucket.org:aerocare-dev/serverless_function_skeleton_bref.git'

The constructor in the Process.php file is set as below:

public function __construct(array $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
If I changed to the below, it just works.
public function __construct( $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)

Any ideas?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions