php-git-hooks icon indicating copy to clipboard operation
php-git-hooks copied to clipboard

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

Open s2925534 opened this issue 5 years ago • 0 comments

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', '[email protected]...') #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', '[email protected]...') #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 '[email protected]: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?

s2925534 avatar Jul 02 '20 10:07 s2925534