### Initial GrumPHP Stylelint Task Configuration Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/stylelint.md An example of the basic `grumphp.yml` configuration for integrating the Stylelint task, showing common parameters and their default or example values for a typical setup. ```yaml grumphp: tasks: stylelint: bin: node_modules/.bin/stylelint triggered_by: [css, scss, sass, less, sss] whitelist_patterns: - /^resources\/css\/(.*)/ config: ~ config_basedir: ~ ignore_path: ~ ignore_pattern: ~ syntax: ~ custom_syntax: ~ ignore_disables: ~ disable_default_ignores: ~ cache: ~ cache_location: ~ formatter: ~ custom_formatter: ~ quiet: ~ color: ~ report_needless_disables: ~ report_invalid_scope_disables: ~ report_descriptionless_disables: ~ max_warnings: ~ output_file: ~ ``` -------------------------------- ### Example YAML Service Configuration for GrumPHP Extension Source: https://github.com/phpro/grumphp/blob/v2.x/UPGRADE-v2.md Provides an example of a YAML configuration file for declaring services in a GrumPHP extension. This approach is required in v2 due to the new extension system, which mandates external configuration files for service definitions to ensure compatibility with `grumphp-shim`'s scoped dependencies. ```yaml # /path/to/my/config.yaml services: xxxxxx: xxxx ``` -------------------------------- ### Install Stylelint Globally using npm Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/stylelint.md Installs the Stylelint command-line interface (CLI) globally on your system. This allows you to run Stylelint from any directory without needing it as a project dependency. ```bash npm install -g stylelint ``` -------------------------------- ### GrumPHP Environment Files Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Example demonstrating how to specify a list of INI or `.env` files for GrumPHP to load into its environment, making variables from these files available. ```yaml # grumphp.yml grumphp: environment: files: - .env - .env.local ``` -------------------------------- ### Install GrumPHP via Composer or Phive Source: https://github.com/phpro/grumphp/blob/v2.x/README.md Instructions for installing GrumPHP as a development dependency using Composer (with or without dependencies) or Phive for automated Git hook setup. The `grumphp-shim` package installs GrumPHP as a PHAR without its dependencies, while `phpro/grumphp` includes them. Phive offers an alternative for dependency-free installation and automated hook management. ```sh composer require --dev phpro/grumphp-shim ``` ```sh composer require --dev phpro/grumphp ``` ```sh phive install grumphp ``` -------------------------------- ### Install Kahlan with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/kahlan.md Installs the Kahlan test framework as a development dependency using Composer. This command should be run in your project's root directory. ```bash composer require --dev kahlan/kahlan ``` -------------------------------- ### GrumPHP Codeception Task YAML Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/codeception.md An example YAML configuration snippet for the Codeception task within `grumphp.yml`, illustrating the available parameters and their default settings. ```YAML # grumphp.yml grumphp: tasks: codeception: config_file: ~ fail_fast: false suite: ~ test: ~ xml: false html: false ``` -------------------------------- ### Configure PHPLint Task in GrumPHP Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phplint.md Example YAML configuration for integrating the PHPLint task into your GrumPHP setup. This snippet demonstrates how to define the `phplint` task and set its various options within the `grumphp.yml` file. ```YAML # grumphp.yml grumphp: tasks: phplint: exclude: [] jobs: ~ short_open_tag: false ignore_patterns: [] triggered_by: ['php', 'phtml', 'php3', 'php4', 'php5'] ``` -------------------------------- ### Install Phing with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phing.md Installs the Phing library as a development dependency using Composer, a dependency manager for PHP. ```bash composer require --dev phing/phing ``` -------------------------------- ### GrumPHP Full Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Illustrates the complete structure and default values for the `grumphp.yml` configuration file, showing all available top-level parameters and their typical settings. ```yaml # grumphp.yml grumphp: hooks_dir: ~ hooks_preset: local git_hook_variables: VAGRANT_HOST_DIR: . VAGRANT_PROJECT_DIR: /var/www EXEC_GRUMPHP_COMMAND: exec ENV: {} stop_on_failure: false ignore_unstaged_changes: false hide_circumvention_tip: false process_timeout: 60 additional_info: ~ ascii: failed: resource/grumphp-grumpy.txt succeeded: resource/grumphp-happy.txt parallel: enabled: true max_workers: 32 fixer: enabled: true fix_by_default: false environment: files: [] variables: {} paths: [] ``` -------------------------------- ### GrumPHP Environment Variables Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Example showing how to define environment variables directly within the GrumPHP configuration file, providing custom key-value pairs for the execution environment. ```yaml # grumphp.yml grumphp: environment: variables: VAR1: "content" VAR2: "content" ``` -------------------------------- ### GrumPHP PHP Parser Task Base Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpparser.md Example YAML configuration for the `php_parser` task within `grumphp.yml`, illustrating its main parameters and their default values. ```yaml # grumphp.yml grumphp: tasks: phpparser: ignore_patterns: [] php_version: null visitors: {} triggered_by: [php] ``` -------------------------------- ### Install Rector via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/rector.md Installs the Rector tool as a development dependency using Composer. ```bash composer require --dev rector/rector ``` -------------------------------- ### Install Psalm via Composer (Development) Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/psalm.md Installs Psalm as a development dependency using Composer. This is the standard way to include Psalm in a PHP project for static analysis. ```bash composer require --dev vimeo/psalm ``` -------------------------------- ### GrumPHP Environment Paths Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Example illustrating how to prepend custom paths to the system's `$PATH` variable for GrumPHP's execution, useful for including project-specific tools (e.g., phive tools) without adding them as composer dev dependencies. ```yaml # grumphp.yml grumphp: environment: paths: - tools ``` -------------------------------- ### GrumPHP Kahlan Task Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/kahlan.md An example YAML configuration block for the Kahlan task within `grumphp.yml`, showcasing all available parameters and their default values. This allows for fine-grained control over how Kahlan tests are executed by GrumPHP. ```yaml grumphp: tasks: kahlan: config: ~ src: ~ spec: ~ pattern: ~ reporter: ~ coverage: ~ clover: ~ istanbul: ~ lcov: ~ ff: ~ no_colors: ~ no_header: ~ include: ~ exclude: ~ persistent: ~ cc: ~ autoclear: ~ ``` -------------------------------- ### Install Codeception for GrumPHP with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/codeception.md Installs Codeception as a development dependency using Composer. This is a prerequisite for integrating Codeception tests with GrumPHP. ```Bash composer require --dev codeception/codeception ``` -------------------------------- ### Install EasyCodingStandard Composer Dependency Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/ecs.md Installs the `symplify/easy-coding-standard` package as a development dependency using Composer. This package provides the core functionality for EasyCodingStandard. ```bash composer require --dev symplify/easy-coding-standard ``` -------------------------------- ### GrumPHP Nette Tester Task YAML Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/tester.md An example YAML configuration block for the 'tester' task in grumphp.yml, showcasing all available parameters and their default values for customizing Nette Tester's behavior within GrumPHP. ```YAML grumphp: tasks: tester: path: "." always_execute: false log: ~ show_information_about_skipped_tests: false stop_on_fail: false parallel_processes: ~ output: ~ temp: ~ setup: ~ colors: ~ coverage: ~ coverage_src: ~ php_ini_configuration_path: null load_php_ini_configuration: false ``` -------------------------------- ### Install PhpCpd with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpcpd.md Installs the PhpCpd tool as a development dependency using Composer. This command should be run in your project's root directory. ```Bash composer require --dev sebastian/phpcpd ``` -------------------------------- ### Install Stylelint as a Development Dependency using npm Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/stylelint.md Installs Stylelint as a local development dependency for your project. This is the recommended approach for most projects, ensuring consistent versions across development environments and allowing project-specific configurations. ```bash npm install --save-dev stylelint ``` -------------------------------- ### GrumPHP Composer Configuration Options Source: https://github.com/phpro/grumphp/blob/v2.x/doc/installation/exotic.md Documentation for configuration keys available under `extra.grumphp` in `composer.json`, used to customize GrumPHP's behavior and path discovery. ```APIDOC grumphp: config-default-path: type: string default: null description: The path to your Grumphp configuration file. project-path: type: string default: null description: The path to the root of your project. This must be a subdirectory of your git working directory. disable-plugin: type: boolean default: false description: If true, prevents Composer from automatically initializing GrumPHP. ``` -------------------------------- ### GrumPHP Behat Task Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/behat.md An example configuration snippet for the Behat task within GrumPHP's `grumphp.yml` file. It shows the basic structure and available parameters with their default placeholder values. ```yaml # grumphp.yml grumphp: tasks: behat: config: ~ format: ~ suite: ~ profile: ~ stop_on_failure: false ``` -------------------------------- ### Install GrumPHP Globally via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/installation/global.md This command installs the GrumPHP executable globally using Composer, making it available system-wide. The executable will be placed in the `~/.composer/vendor/bin` folder. ```sh composer global require phpro/grumphp ``` -------------------------------- ### GrumPHP Gulp Task YAML Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/gulp.md Example YAML configuration for integrating the Gulp task into GrumPHP's `grumphp.yml` file, showing default parameter values and structure. ```YAML grumphp: tasks: gulp: gulp_file: ~ task: ~ triggered_by: [js, jsx, coffee, ts, less, sass, scss] ``` -------------------------------- ### GrumPHP Main Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/README.md An example `grumphp.yml` configuration file demonstrating various top-level settings for GrumPHP. This includes defining Git hook variables, controlling commit stopping on failure, ignoring unstaged changes, setting process timeouts, configuring ASCII art for success/failure, enabling parallel task execution, and configuring the code fixer. ```yaml # grumphp.yml grumphp: hooks_dir: ~ hooks_preset: local git_hook_variables: VAGRANT_HOST_DIR: . VAGRANT_PROJECT_DIR: /var/www EXEC_GRUMPHP_COMMAND: exec ENV: {} stop_on_failure: false ignore_unstaged_changes: false hide_circumvention_tip: false process_timeout: 60 ascii: failed: grumphp-grumpy.txt succeeded: grumphp-happy.txt parallel: enabled: true max_workers: 32 fixer: enabled: true fix_by_default: false environment: files: [] variables: {} paths: [] tasks: {} testsuites: [] extensions: [] ``` -------------------------------- ### GrumPHP JsonLint Task YAML Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/jsonlint.md An example `grumphp.yml` configuration snippet demonstrating how to enable and set parameters for the `jsonlint` task within GrumPHP. This shows the default values for `ignore_patterns` and `detect_key_conflicts`. ```yaml # grumphp.yml grumphp: tasks: jsonlint: ignore_patterns: [] detect_key_conflicts: false ``` -------------------------------- ### Install PHPStan Development Dependency Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpstan.md Installs PHPStan as a development dependency for your project using Composer, making it available for static analysis. ```bash composer require --dev phpstan/phpstan ``` -------------------------------- ### Install Psalm Phar via Composer (Development) Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/psalm.md Installs the Phar (PHP Archive) version of Psalm as a development dependency using Composer. This is an alternative for projects preferring a self-contained executable. ```bash composer require --dev psalm/phar ``` -------------------------------- ### GrumPHP PHPStan Task Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpstan.md Illustrates the basic YAML configuration for the PHPStan task within the `grumphp.yml` file, showcasing various configurable parameters and their default values. ```yaml # grumphp.yml grumphp: tasks: phpstan: autoload_file: ~ configuration: ~ level: null force_patterns: [] ignore_patterns: [] triggered_by: ['php'] memory_limit: "-1" use_grumphp_paths: true ``` -------------------------------- ### Install Php7cc Composer Package Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/php7cc.md This command installs the `sstalle/php7cc` package as a development dependency using Composer. It's a prerequisite for using the Php7cc task in GrumPHP. ```Bash composer require --dev sstalle/php7cc ``` -------------------------------- ### Install PHPLint Composer Dependency Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phplint.md Installs the `php-parallel-lint/php-parallel-lint` package as a development dependency using Composer, which is required for the PHPLint GrumPHP task to function. ```Bash composer require --dev php-parallel-lint/php-parallel-lint ``` -------------------------------- ### GrumPHP Shell Task Scripts Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/shell.md Demonstrates how to specify shell scripts or commands to be executed by the Shell task. It shows examples of running a direct script file and executing an inline command using the `-c` option. ```yaml # grumphp.yml grumphp: tasks: shell: scripts: - script.sh - ["-c", "./bin/command arg1 arg2"] ``` -------------------------------- ### Install Pest PHP Development Dependency Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/pest.md Installs the Pest PHP testing framework as a development dependency for your project using Composer. This command should be run in your project's root directory. ```bash composer require --dev pestphp/pest ``` -------------------------------- ### Example GrumPHP Composer Script Task Configuration Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/composer_script.md Illustrates the basic YAML configuration for the `composer_script` task within `grumphp.yml`, showing how to define the script to run, the file types that trigger it, and the working directory for execution. ```yaml grumphp: tasks: composer_script: script: ~ triggered_by: [php, phtml] working_directory: ~ ``` -------------------------------- ### Install ESLint Globally via npm Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/eslint.md Installs the ESLint command-line interface globally on the system. This makes the `eslint` command available from any directory on your machine, useful for general-purpose linting. ```bash npm install -g eslint ``` -------------------------------- ### Install Robo via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/robo.md This Composer command adds the `consolidation/robo` package as a development dependency to your PHP project, making it available for use with GrumPHP. ```bash composer require --dev consolidation/robo ``` -------------------------------- ### GrumPHP NPM Script Task YAML Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/npm_script.md An example YAML configuration snippet for integrating the `npm_script` task into your `grumphp.yml` file, demonstrating how to define the script, triggered file types, and other operational parameters. ```yaml grumphp: tasks: npm_script: script: ~ triggered_by: [js, jsx, coffee, ts, less, sass, scss] working_directory: "./" is_run_task: false silent: false ``` -------------------------------- ### Install Behat via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/behat.md Installs Behat as a development dependency using Composer, a PHP package manager. This command should be run in your project's root directory. ```bash composer require --dev behat/behat ``` -------------------------------- ### GrumPHP Grunt Task YAML Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/grunt.md Example YAML configuration for integrating and customizing the Grunt task within GrumPHP's `grumphp.yml` file, specifying its namespace and configurable parameters. ```YAML # grumphp.yml grumphp: tasks: grunt: grunt_file: ~ task: ~ triggered_by: [js, jsx, coffee, ts, less, sass, scss] ``` -------------------------------- ### Configure Phing Task in GrumPHP Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phing.md Example YAML configuration for the Phing task within GrumPHP, demonstrating how to set parameters such as the build file, the specific Phing task to execute, and the file extensions that trigger the task. ```yaml # grumphp.yml grumphp: tasks: phing: build_file: ~ task: ~ triggered_by: [php] ``` -------------------------------- ### Install PHPUnit via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpunit.md This command adds PHPUnit as a development dependency to your project using Composer, making it available for use in your development environment and CI/CD pipelines. ```Bash composer require --dev phpunit/phpunit ``` -------------------------------- ### Install Paratest with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/paratest.md This command adds the 'brianium/paratest' package as a development dependency to your PHP project using Composer, making it available for use with GrumPHP. ```Bash composer require --dev brianium/paratest ``` -------------------------------- ### Install Nette Tester with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/tester.md This command adds the Nette Tester package as a development dependency to your PHP project using Composer, making it available for GrumPHP to utilize. ```Bash composer require nette/tester --dev ``` -------------------------------- ### Install Progpilot via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/progpilot.md Commands to add Progpilot as a development dependency to your project and configure Composer's minimum stability to allow for dev versions. ```Shell composer config minimum-stability dev composer require --dev designsecurity/progpilot:dev-master ``` -------------------------------- ### Install Roave Security Advisories with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/securitychecker/roave.md This command installs the `roave/security-advisories` package as a development dependency using Composer. This package provides known security vulnerabilities for PHP projects. ```bash composer require --dev roave/security-advisories:dev-latest ``` -------------------------------- ### Configure GrumPHP Environment Paths for Binaries Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/stylelint.md Demonstrates how to add `node_modules/.bin` to GrumPHP's environment paths. This allows GrumPHP to automatically discover locally installed project binaries, such as Stylelint, without needing to specify their full path in each task configuration. ```yaml grumphp: environment: paths: - node_modules/.bin ``` -------------------------------- ### Configure Phpcs Standard for Magento Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpcs.md Initiates the configuration for setting the `standard` parameter in `grumphp.yml` to use the installed Magento PHP_CodeSniffer standard. The provided snippet is incomplete but shows the starting structure. ```yaml # grumphp.yml grumphp: tasks: phpcs: standard: ``` -------------------------------- ### Configure YamlLint Task in GrumPHP Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/yamllint.md Example configuration for the `yamllint` task within `grumphp.yml`, showing common parameters and their default values. This snippet demonstrates how to integrate YamlLint into your GrumPHP workflow. ```yaml # grumphp.yml grumphp: tasks: yamllint: whitelist_patterns: [] ignore_patterns: [] object_support: false exception_on_invalid_type: false parse_constant: false parse_custom_tags: false ``` -------------------------------- ### Configure Rector Task in GrumPHP Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/rector.md Example configuration for the Rector task within GrumPHP's `grumphp.yml` file, showing available parameters and their default values. ```yaml # grumphp.yml grumphp: tasks: rector: config: null triggered_by: ['php'] ignore_patterns: [] clear_cache: true no_diffs: false ``` -------------------------------- ### GrumPHP PhpMd Task Configuration Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpmd.md Example YAML configuration for the PhpMd task within `grumphp.yml`. This snippet shows the default parameters for `whitelist_patterns`, `exclude`, `report_format`, `ruleset`, and `triggered_by`, allowing customization of PhpMd's behavior within your GrumPHP setup. ```yaml # grumphp.yml grumphp: tasks: phpmd: whitelist_patterns: [] exclude: [] report_format: text ruleset: ['cleancode', 'codesize', 'naming'] triggered_by: ['php'] ``` -------------------------------- ### GrumPHP `environment` Configuration Parameters Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Documentation for GrumPHP's environment configuration, including loading external files, defining inline variables, and managing system paths for tool discovery. ```APIDOC environment: files: string[] Default: [] Description: A list of INI or .env files that need to be loaded into the environment. variables: object Default: {} Description: Key-value pairs of environment variables to be set directly within the configuration. paths: string[] Default: [] Description: A list of paths to be prepended to the system's $PATH variable whilst running GrumPHP. ``` -------------------------------- ### Install PHP-Parser Composer Dependency Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpparser.md Command to add `nikic/php-parser` as a development dependency to your project using Composer. ```bash composer require --dev nikic/php-parser ``` -------------------------------- ### Configure Environment Variables for GrumPHP Tasks Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Example demonstrating how to set global environment variables for GrumPHP tasks using the `environment.variables` section, specifically showing how to ensure integer values are treated as strings. ```yaml # grumphp.yml grumphp: environment: variables: PHP_CS_FIXER_IGNORE_ENV: "1" ``` -------------------------------- ### Install Phan via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phan.md This command adds Phan as a development dependency to your PHP project using Composer, making it available for static analysis. ```Shell composer require --dev phan/phan ``` -------------------------------- ### GrumPHP Pest Task Configuration Parameters Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/pest.md Detailed documentation for the configurable parameters of the GrumPHP Pest task. Each parameter's default value, type, and purpose are described, along with usage examples where applicable. ```APIDOC pest_task_parameters: config_file: type: string | null default: null description: Specifies the path to a custom phpunit.xml configuration file. If null, it automatically loads phpunit.xml or phpunit.xml.dist from the current directory. testsuite: type: string | null default: null description: Runs tests only from a specified test suite. example: testsuite: unit group: type: array default: [] description: Runs tests only from specified groups. example: group: [fast,quick,small] always_execute: type: boolean default: false description: Forces the execution of the entire test suite, regardless of file changes. ``` -------------------------------- ### Configure GrumPHP Git Blacklist Task Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/git_blacklist.md Example configuration for the GrumPHP `git_blacklist` task within `grumphp.yml`, demonstrating how to specify blacklisted keywords, file types to trigger on, and other matching options. ```YAML grumphp: tasks: git_blacklist: keywords: - "die\(" - "var_dump\(" - "exit;" whitelist_patterns: [] triggered_by: ['php'] regexp_type: G match_word: false ignore_patterns: [] ``` -------------------------------- ### Generate ESLint Configuration File Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/eslint.md Initializes an ESLint configuration file (`.eslintrc.*`) in the current directory. This command guides the user through a series of questions to set up basic linting rules and environments for their project. ```bash npx eslint --init ``` -------------------------------- ### Install Composer Normalize Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/composer_normalize.md Installs the `ergebnis/composer-normalize` package as a development dependency using Composer. This package is required for the GrumPHP task to function. ```Bash composer require --dev ergebnis/composer-normalize ``` -------------------------------- ### Install Composer Require Checker Dependency Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/composer_require_checker.md Installs the `maglnet/composer-require-checker` package as a development dependency using Composer, which is required for the GrumPHP task. ```bash composer require --dev maglnet/composer-require-checker ``` -------------------------------- ### GrumPHP Phpunit Task Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpunit.md This YAML configuration block illustrates how to define and customize the Phpunit task within your `grumphp.yml` file. It shows the default structure and available parameters for controlling test execution and reporting. ```YAML # grumphp.yml grumphp: tasks: phpunit: config_file: ~ testsuite: ~ group: [] exclude_group: [] always_execute: false order: null coverage-clover: null coverage-html: null coverage-php: null coverage-xml: null ``` -------------------------------- ### Install TwigCs via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/twigcs.md Installs the 'friendsoftwig/twigcs' package as a development dependency for your project using Composer, ensuring it's available for GrumPHP to utilize. ```bash composer require --dev "friendsoftwig/twigcs:>=4" ``` -------------------------------- ### Re-initialize Git Hooks for GrumPHP Source: https://github.com/phpro/grumphp/blob/v2.x/doc/installation/exotic.md Command to re-initialize GrumPHP's Git hooks after changing configuration parameters in `composer.json` or other settings. This ensures that the new configurations are applied to the Git hooks. ```sh php ./vendor/bin/grumphp git:init ``` -------------------------------- ### Install Phpspec Development Dependency with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpspec.md Installs the Phpspec testing framework as a development dependency for your project using Composer, making it available for code specification. ```Bash composer require --dev phpspec/phpspec ``` -------------------------------- ### GrumPHP Stylelint Task Configuration Parameters Reference Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/stylelint.md Detailed documentation for each configurable parameter of the GrumPHP Stylelint task, including default values, purpose, and references to Stylelint's official documentation where applicable. ```APIDOC bin: Default: null Description: The path to your stylelint bin executable. Not necessary if stylelint is in your $PATH. Can be used to specify path to project's stylelint over globally installed stylelint. ``` ```APIDOC triggered_by: Default: [css, scss, sass, less, sss] Description: This is a list of extensions which will trigger the Sylelint task. ``` ```APIDOC whitelist_patterns: Default: [] Description: This is a list of regex patterns that will filter files to validate. With this option you can specify the folders containing javascript files and thus skip folders like /tests/ or the /vendor/ directory. This option is used in conjunction with the parameter 'triggered_by'. ``` ```APIDOC config: Default: null Description: Path to a JSON, YAML, or JS file that contains your configuration object. (stylelint.io) ``` ```APIDOC config_basedir: Default: null Description: Absolute path to the directory that relative paths defining "extends" and "plugins" are _relative_ to. Only necessary if these values are relative paths. (stylelint.io) ``` ```APIDOC ignore_path: Default: null Description: A path to a file containing patterns describing files to ignore. The path can be absolute or relative to 'process.cwd()'. By default, stylelint looks for '.stylelintignore' in 'process.cwd()'. (stylelint.io) ``` ```APIDOC ignore_pattern: Default: null Description: Pattern of files to ignore (in addition to those in '.stylelintignore'). (stylelint.io) ``` ```APIDOC syntax: Default: null Description: Specify a syntax. (stylelint.io) ``` ```APIDOC custom_syntax: Default: null Description: Specify a custom syntax to use on your code. Use this option if you want to force a specific syntax that's not already built into stylelint. (stylelint.io) ``` ```APIDOC ignore_disables: Default: null Description: Ignore 'styleline-disable' (e.g. '/* stylelint-disable block-no-empty */') comments. (stylelint.io) ``` ```APIDOC disable_default_ignores: Default: null Description: Disable the default ignores. stylelint will not automatically ignore the contents of 'node_modules'. (stylelint.io) ``` ```APIDOC cache: Default: null Description: Store the results of processed files so that stylelint only operates on the changed ones. By default, the cache is stored in './.stylelintcache' in 'process.cwd()'. (stylelint.io) ``` ```APIDOC cache_location: Default: null Description: Path to a file or directory for the cache location. (stylelint.io) ``` ```APIDOC formatter / custom_formatter: Default: null Description: Specify the formatter to format your results. (stylelint.io) ``` ```APIDOC quiet: Default: null Description: Only register violations for rules with an "error"-level severity (ignore "warning"-level). (stylelint.io) ``` ```APIDOC color: Default: null Description: Force enabling/disabling of color. (stylelint.io) ``` ```APIDOC report_needless_disables: Default: null Description: Produce a report to clean up your codebase, keeping only the 'stylelint-disable' comments that serve a purpose. (stylelint.io) ``` ```APIDOC report_invalid_scope_disables: Default: null Description: (Description truncated in source text) ``` -------------------------------- ### Configure Php7cc Task in GrumPHP YAML Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/php7cc.md Example YAML configuration for integrating the `php7cc` task into your `grumphp.yml` file. It shows the default structure and common parameters for customizing the task's behavior. ```YAML # grumphp.yml grumphp: tasks: php7cc: exclude: [] level: ~ triggered_by: ['php'] ``` -------------------------------- ### Example STDIN Usage for GrumPHP Git Hook Commands Source: https://github.com/phpro/grumphp/blob/v2.x/doc/commands.md Demonstrates how to pipe Git diffs (staged or unstaged) or specific file lists to GrumPHP's 'git:pre-commit' command. This allows for precise control over which changes are analyzed by GrumPHP. ```sh git diff | php ./vendor/bin/grumphp git:pre-commit ``` ```sh git diff --staged | php ./vendor/bin/grumphp git:pre-commit ``` ```sh git ls-files src | php ./vendor/bin/grumphp git:pre-commit ``` -------------------------------- ### Install PhpMd via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpmd.md Installs the PhpMd package as a development dependency for your project using Composer. This command should be run in your project's root directory. ```bash composer require --dev phpmd/phpmd ``` -------------------------------- ### Configure GrumPHP Pest Task in YAML Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/pest.md Example YAML configuration for the Pest task within GrumPHP's `grumphp.yml` file. It shows the default structure and available parameters for customizing Pest test execution. ```yaml # grumphp.yml grumphp: tasks: pest: config_file: ~ testsuite: ~ group: [] always_execute: false ``` -------------------------------- ### Install PHP-CS-Fixer via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpcsfixer.md This Composer command installs the `friendsofphp/php-cs-fixer` package as a development dependency. It's a prerequisite for using the PHP-CS-Fixer task within your project's development environment. ```bash composer require --dev friendsofphp/php-cs-fixer ``` -------------------------------- ### Run GrumPHP with a Custom Configuration File via CLI Source: https://github.com/phpro/grumphp/blob/v2.x/doc/installation/exotic.md Commands to specify an alternative GrumPHP configuration file using the `--config` CLI parameter for `git:init` and `run` commands. This method provides the highest priority for configuration file selection. ```sh php ./vendor/bin/grumphp git:init --config='custom/grumphp.yml' php ./vendor/bin/grumphp run --config='custom/grumphp.yml' ``` -------------------------------- ### Configure GrumPHP Paths in composer.json Source: https://github.com/phpro/grumphp/blob/v2.x/doc/installation/exotic.md Demonstrates how to set GrumPHP configuration paths and plugin behavior within the `extra.grumphp` section of your `composer.json` file. This method has high priority and is used when no environment variables are set. ```json { "extra": { "grumphp": { "config-default-path": "path/to/grumphp.yml", "project-path": "path/to/your/project/folder", "disable-plugin": false } } } ``` -------------------------------- ### Basic GrumPHP Configuration Structure Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Illustrates the fundamental structure of a `grumphp.yml` configuration file, including a general informational field. ```yaml grumphp: additional_info: "\nTo get full documentation for the project!\nVisit https://docs.example.com\n" ``` -------------------------------- ### PHPLint Task Configuration Options Reference Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phplint.md Detailed reference for the configuration options available for the PHPLint task in GrumPHP, including their types, default values, and descriptions. ```APIDOC phplint_task_options: exclude: type: array default: [] description: Any directories to be excluded from linting. For example, the vendor directory. jobs: type: integer | null default: null description: The number of jobs to use for parallel processing. If null, parallel-lint defaults to 10. short_open_tag: type: boolean default: false description: Allows or disallows PHP short open tags. ignore_patterns: type: array default: [] description: A list of patterns (e.g., file paths or regex) that will be ignored by PHPLint. Leave blank to lint all PHP files. triggered_by: type: array default: ['php', 'phtml', 'php3', 'php4', 'php5'] description: A list of file extensions that will be passed to the linter for processing. ``` -------------------------------- ### GrumPHP Psalm Task Configuration Parameters Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/psalm.md Detailed documentation for the configurable parameters of the Psalm task within GrumPHP. This section describes each parameter's purpose, default value, and available options for fine-tuning Psalm's execution. ```APIDOC psalm_task_parameters: config: type: string default: null description: Path to the project's Psalm configuration file. ignore_patterns: type: array default: [] description: List of patterns for files/directories to be ignored by Psalm. Leave blank to run Psalm for every PHP file/directory specified in your configuration. no_cache: type: boolean default: false description: Run Psalm without using the cache file. report: type: string default: null description: Path to specify the Psalm report file. output_format: type: string default: null description: Changes the output format. available_formats: compact, console, emacs, json, pylint, xml, checkstyle, junit, sonarqube threads: type: integer default: null description: Defines on how many threads Psalm's analysis stage is run. triggered_by: type: array default: ['php'] description: List of file extensions to be sniffed by Psalm. show_info: type: boolean default: false description: Show non-exception parser findings. ``` -------------------------------- ### GrumPHP Deptrac Task YAML Configuration Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/deptrac.md Example YAML configuration for integrating and customizing the Deptrac task within your GrumPHP setup. This snippet shows how to define the 'deptrac' task under the 'tasks' section. The configurable parameters include 'cache_file' for specifying the cache location (e.g., '/var/www/src/.deptrac.cache'), 'depfile' for setting the path to the deptrac configuration file (e.g., '/var/www/src/deptrac.yaml'), 'formatter' to enable and select an output format (e.g., 'console', 'junit', 'json'), and 'output' to define the file path for the formatter's output. ```YAML grumphp: tasks: deptrac: cache_file: ~ depfile: ~ formatter: ~ output: ~ ``` -------------------------------- ### Install Enlightn Security Checker with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/securitychecker/enlightn.md Installs the Enlightn Security Checker as a development dependency using Composer, making it available for use in your project's development environment. ```bash composer require --dev enlightn/security-checker ``` -------------------------------- ### GrumPHP Parameter: hooks_preset Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Documentation for the `hooks_preset` parameter, detailing its default value, when it's used (only without a custom `hooks_dir`), and the available presets (`local`, `vagrant`) with their descriptions. ```APIDOC hooks_preset: Default: local Description: This parameter will tell GrumPHP which hooks preset to use. Presets are only used when you did NOT specify a custom `hooks_dir`. GrumPHP comes with following presets: - `local`: All checks will run on your local computer. - `vagrant`: All checks will run in your vagrant box (you certainly want to customize `git_hook_variables` default values in this case). ``` -------------------------------- ### Install Symfony Phpunit Bridge with Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpunitbridge.md Installs the Symfony Phpunit Bridge as a development dependency using Composer, which is required for the Phpunit Bridge GrumPHP task to function. ```bash composer require --dev symfony/phpunit-bridge ``` -------------------------------- ### Install Magento PHP_CodeSniffer Standard Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpcs.md Installs the `magento-ecg/coding-standard` package as a development dependency via Composer. This standard is compatible with both Magento 1 and Magento 2 projects for code sniffing. ```sh composer require --dev magento-ecg/coding-standard ``` -------------------------------- ### Install PHP_CodeSniffer via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpcs.md Installs the `squizlabs/php_codesniffer` package as a development dependency using Composer. This package provides the core PHP_CodeSniffer functionality required by the GrumPHP Phpcs task. ```sh composer require --dev squizlabs/php_codesniffer ``` -------------------------------- ### General Stylelint Configuration via Config File Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/stylelint.md Provides guidance that any other stylelint settings not explicitly listed here should be configured directly through a standard stylelint configuration file. This ensures comprehensive control over linting rules and behavior. ```APIDOC Other Stylelint Settings: Description: Any other stylelint settings should be able to be set through a stylelint config file. Reference: https://stylelint.io/user-guide/configure ``` -------------------------------- ### GrumPHP Composer Audit Security Checker Task Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/securitychecker/composeraudit.md Example `grumphp.yml` configuration for the `securitychecker_composeraudit` task, demonstrating how to enable and configure its various parameters. ```yaml grumphp: tasks: securitychecker_composeraudit: abandoned: null format: null locked: true no_dev: false run_always: false working_dir: null ``` -------------------------------- ### GrumPHP Nette Tester Task Configuration Parameters API Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/tester.md Detailed API documentation for each configurable parameter of the GrumPHP 'tester' task, including their default values, purpose, and usage guidelines. ```APIDOC Parameter: path Default: . Description: The test directory that contains the tests that need to be executed. Parameter: always_execute Default: false Description: Always run the whole test suite, even if no PHP files were changed. Parameter: log Default: null Description: You can write the testing progress to a file. Parameter: show_information_about_skipped_tests Default: false Description: When this option is set to `true`, the task will show information about skipped tests. Parameter: stop_on_fail Default: false Description: When this option is set to `true`, the task will stop after the first failing test. Parameter: parallel_processes Default: null (By default, this value is 8) Description: The tests run in parallel processes. By default, this value is `8`. If you wish to run tests in series, use `1`. Parameter: output Default: null (By default, the format is console) Description: You can choose the format of the output. The available options are `console`, `tap`, `machine`, `junit` and `none`. By default the format is `console`. Parameter: temp Default: null (The Default value is sys_get_temp_dir()) Description: Sets a path to directory for temporary files of Tester. The Default value is `sys_get_temp_dir()`. Parameter: setup Default: null Description: The Tester loads the given PHP script on start. Parameter: colors Default: null (The default is 1) Description: You can disable color in terminal by setting the value to `0`, the default is `1`. Parameter: coverage Default: null Description: Generate a report. The file extension determines the contents format. Only HTML or Clover reports are supported. Example: `coverage.html` or `coverage.xml` Parameter: coverage_src Default: null Description: This is issued with the `coverage` option. This is a path to the source code for which we generate the report. Parameter: php_ini_configuration_path Default: null Description: The Tester runs PHP processes from custom php.ini file. Parameter: default_php_ini_configuration Default: false Description: When this option is set to `true`, Tester runs PHP processes with system configuration .ini files. ``` -------------------------------- ### Install Drupal Coder via Composer Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpcs.md Command to install the Drupal Coder (Code Sniffer) as a development dependency using Composer. This package provides the Drupal coding standards for PHPCS. ```sh composer require --dev drupal/coder ``` -------------------------------- ### Example GrumPHP Atoum Task Configuration Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/atoum.md This YAML snippet demonstrates how to configure the Atoum task within your `grumphp.yml` file. It shows how to specify paths for configuration and bootstrap files, and how to limit test execution to specific directories, files, namespaces, methods, or tags. ```YAML grumphp: tasks: atoum: config_file: .atoum.php bootstrap_file: tests/units/bootstrap.php directories: - tests/units files: - tests/units/MyTest.php namespaces: - mageekguy\\atoum\\tests\\units\\asserters methods: - mageekguy\\atoum\\tests\\units\\asserters\\string::testContains - mageekguy\\atoum\\tests\\units\\asserters\\string::* tags: - thisIsOneTag - thisIsThreeTag ``` -------------------------------- ### Install Symfony 2 PHP_CodeSniffer Standard Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpcs.md Installs the `leaphub/phpcs-symfony2-standard` package as a development dependency via Composer. This standard provides specific coding rules tailored for Symfony 2 projects. ```sh composer require --dev leaphub/phpcs-symfony2-standard ``` -------------------------------- ### GrumPHP Brunch Task YAML Configuration Example Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/brunch.md This YAML snippet demonstrates how to configure the 'brunch' task within GrumPHP's `grumphp.yml` file. It sets up the build task, environment, parallel jobs, debug mode, and file extensions that trigger the task. ```yaml # grumphp.yml grumphp: tasks: brunch: task: build env: production jobs: 4 debug: false triggered_by: [js, jsx, coffee, ts, less, sass, scss] ``` -------------------------------- ### GrumPHP Kahlan Task Configuration Parameters Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/kahlan.md Detailed documentation for each configurable parameter of the Kahlan task in GrumPHP, including their default values and a description of their purpose. These parameters control aspects like configuration files, source/spec directories, reporting, and code coverage. ```APIDOC config: Default: 'kahlan-config.php' Description: The PHP configuration file to use src: Default: ['src'] Description: Paths of source directories spec: Default: ['spec'] Description: Paths of specification directories pattern: Default: '*Spec.php' Description: A shell wildcard pattern reporter: Default: null Description: The name of the text reporter to use, the built-in text reporters are 'dot', 'bar', 'json', 'tap' & 'verbose'. You can optionally redirect the reporter output to a file by using the colon syntax (multiple --reporter options are also supported). coverage: Default: null Description: Generate code coverage report. The value specify the level of detail for the code coverage report (0-4). If a namespace, class, or method definition is provided, it will generate a detailed code coverage of this specific scope. clover: Default: null Description: Export code coverage report into a Clover XML format. istanbul: Default: null Description: Export code coverage report into an istanbul compatible JSON format. lcov: Default: null Description: Export code coverage report into a lcov compatible text format. ff: Default: 0 Description: Fast fail option. `0` mean unlimited no_colors: Default: `false` Description: To turn off colors. no_header: Default: `false` Description: To turn off header. include: Default: ['*'] Description: Paths to include for patching. exclude: Default: [] Description: Paths to exclude for patching. persistent: Default: true Description: Cache patched files. cc: Default: false Description: Clear cache before spec run. autoclear: Default: ['Kahlan\\Plugin\\Monkey','Kahlan\\Plugin\\Call','Kahlan\\Plugin\\Stub','Kahlan\\Plugin\\Quit'] Description: Classes to autoclear after each spec ``` -------------------------------- ### List Installed PHP_CodeSniffer Standards Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/phpcs.md Executes the `phpcs -i` command to display a list of all currently installed PHP_CodeSniffer standards on the system. This helps in identifying available standards for the `standard` configuration parameter. ```sh phpcs -i ``` -------------------------------- ### Install Convention Package for Customizable GrumPHP Conventions Source: https://github.com/phpro/grumphp/blob/v2.x/doc/conventions.md Installs a development dependency for a custom convention package using Composer. This package provides a base `grumphp.yml` that can be imported and extended by individual projects, allowing for flexible customization. ```sh composer require --dev [your-project]/[your-convention-package] ``` -------------------------------- ### Install Convention Package for Hardcoded GrumPHP Conventions Source: https://github.com/phpro/grumphp/blob/v2.x/doc/conventions.md Installs a development dependency for a custom convention package using Composer. This package is intended to contain a `grumphp.yml` file that cannot be customized by the consuming project, enforcing strict conventions. ```sh composer require --dev [your-project]/[your-convention-package] ``` -------------------------------- ### GrumPHP `fixer` Configuration Parameters Source: https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md Documentation for GrumPHP's code fixer settings, covering enablement and default behavior for fixing changes, especially in non-interactive environments. ```APIDOC fixer: enabled: boolean Default: true Description: Enables or disables built-in fixers. fix_by_default: boolean Default: false Description: Sets the default answer for dynamic questions in contexts where interaction is not possible (e.g., git commits). ``` -------------------------------- ### GrumPHP Twig-CS-Fixer Task Configuration Parameters Source: https://github.com/phpro/grumphp/blob/v2.x/doc/tasks/twigcsfixer.md Detailed documentation for the configurable parameters of the `twigcsfixer` task within GrumPHP, including their default values, accepted types, and purpose. ```APIDOC twigcsfixer task parameters: paths: Type: array Default: [] Description: List of paths to check. By default, the current folder is used. On precommit, only changed files within these paths are processed. level: Type: string Default: 'notice' Description: The level of messages to display. Possible values are 'notice', 'warning', 'error'. config: Type: string | null Default: null Description: Path to a .twig-cs-fixer.php config file. If not set, the default config is used. report: Type: string Default: 'text' Description: The output format for the linter report. Supported formats include 'text', 'checkstyle', 'github', 'junit', 'null'. no-cache: Type: boolean Default: false Description: If true, caching will be disabled. verbose: Type: boolean Default: false Description: If true, increases the verbosity of messages. triggered_by: Type: array Default: ['twig'] Description: Specifies which file extensions will trigger this task. ```