phpro / grumphp

A PHP code-quality tool
MIT License
4.14k stars 430 forks source link

Fatal error after upgrade to 0.11.4 #351

Closed edbizarro closed 7 years ago

edbizarro commented 7 years ago
Q A
Version 0.11.4
Bug? yes
New feature? no
Question? no
Documentation? no
Related tickets

GrumPHP start throwing an error after upgrading to 0.11.4

PHP Fatal error:  Uncaught TypeError: Argument 2 passed to GrumPHP\Task\AbstractExternalTask::__construct() must be an instance of GrumPHP\Pr
ocess\ProcessBuilder, none given in /vendor/phpro/grumphp/src/Task/AbstractExternalTas
k.php:31

My configuration

# grumphp.yml
parameters:
  bin_dir: "./vendor/bin"
  git_dir: "."
  stop_on_failure: true
  process_async_limit: 20
  process_async_wait: 1000
  process_timeout: 60
  ascii:
    failed: grumphp-grumpy.txt
    succeeded: grumphp-happy.txt
  tasks:
    composer: ~
    git_blacklist:
      keywords:
        - "die("
        - "var_dump("
        - "exit;"
      triggered_by: [php]
    git_conflict: ~
    jsonlint: ~
#    phpcpd:
#      directory: '.'
#      exclude: ['vendor']
#      names_exclude: []
#      fuzzy: false
#      min_lines: 5
#      min_tokens: 70
#      triggered_by: ['php']
#    phpcs:
#      whitelist_patterns:
#        - /^app\/(.*)/
#      ignore_patterns:
#        - /^tests\/(.*)/
#        - /^database\/(.*)/
#        - /^storage\/(.*)/
#        - /^resources\/(.*)/
#        - /^*.routes.php/
#      standard: 'PSR2'
#      show_warnings: true
#      tab_width: 4
#      triggered_by: [php]
    phplint: ~
#    phpmd: ~
    phpparser: ~
    phpunit: ~
    phpversion: ~
    securitychecker: ~
    shell: ~
    yamllint: ~
    phpcsfixer:
      config_file: './.php_cs'
      fixers:
        - blankline_after_open_tag
        - braces
        - concat_without_spaces
        - double_arrow_multiline_whitespaces
        - duplicate_semicolon
        - elseif
        - empty_return
        - encoding
        - eof_ending
        - extra_empty_lines
        - function_call_space
        - function_declaration
        - include
        - indentation
        - join_function
        - line_after_namespace
        - linefeed
        - list_commas
        - logical_not_operators_with_successor_space
        - lowercase_constants
        - lowercase_keywords
        - method_argument_space
        - multiline_array_trailing_comma
        - multiline_spaces_before_semicolon
        - multiple_use
        - namespace_no_leading_whitespace
        - no_blank_lines_after_class_opening
        - no_empty_lines_after_phpdocs
        - object_operator
        - operators_spaces
        - parenthesis
        - phpdoc_indent
        - phpdoc_inline_tag
        - phpdoc_no_access
        - phpdoc_no_package
        - phpdoc_scalar
        - phpdoc_short_description
        - phpdoc_to_comment
        - phpdoc_trim
        - phpdoc_type_to_var
        - phpdoc_var_without_name
        - remove_leading_slash_use
        - remove_lines_between_uses
        - return
        - self_accessor
        - short_array_syntax
        - short_echo_tag
        - short_tag
        - single_array_no_trailing_comma
        - single_blank_line_before_namespace
        - single_line_after_imports
        - single_quote
        - spaces_before_semicolon
        - spaces_cast
        - standardize_not_equal
        - ternary_spaces
        - trailing_spaces
        - trim_array_spaces
        - unalign_equals
        - unary_operators_spaces
        - unused_use
        - visibility
        - whitespacy_lines
  testsuites: []
  extensions: []

Steps to reproduce:

# Generate empty folder
mkdir tmp
cd tmp
git init
echo "vendor" > .gitignore
pbpaste > grumphp.yml
composer require --dev phpro/grumphp

# Your actions
# Please add the steps on how to reproduce the issue here.

# Run GrumpHP:
git add -A && git commit -m"Test"
# or
./vendor/bin/grumphp run

Result:

PHP Fatal error:  Uncaught TypeError: Argument 2 passed to GrumPHP\Task\AbstractExternalTask::__construct() must be an instance of GrumPHP\Pr
ocess\ProcessBuilder, none given in /vendor/phpro/grumphp/src/Task/AbstractExternalTas
k.php:31
veewee commented 7 years ago

Thanks for reporting @edbizarro! It looks like this is the same issue as #340. Can you verify if removing the git_conflict task works for you? The issue has been solved, but we are thinking about removing the task since it never gets triggered. Feel free to add your feedback to ticket #340.