Skip to content

Commit

Permalink
Merge pull request #18 from mediact/feature/composer-2-compatibility
Browse files Browse the repository at this point in the history
Feature/composer 2 compatibility
  • Loading branch information
ashokadewit authored Dec 24, 2020
2 parents cdefad9 + b77e2bb commit 73278f2
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 8 deletions.
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
"email": "[email protected]"
}
],
"version": "2.1.0",
"require": {
"php": "^7.1",
"composer-plugin-api": "^1.0"
"composer-plugin-api": "^1.0 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"composer/composer": "^1.3",
"composer/composer": "^1.3 || ^2.0",
"kint-php/kint": "@stable",
"mediact/testing-suite": "^2.0",
"mediact/coding-standard": "@stable",
"phpro/grumphp": ">=0.19 <1.0",
"phpstan/phpstan": "@stable",
"sensiolabs/security-checker": "@stable",
"mikey179/vfsstream": "^1.6"
},
"autoload": {
Expand Down
93 changes: 89 additions & 4 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,96 @@
imports:
- resource: 'vendor/mediact/testing-suite/config/default/grumphp.yml'

parameters:
# Default settings for testing suite tasks
composer.strict: false

jsonlint.detect_key_conflicts: true

xmllint.load_from_net: true
xmllint.x_include: true
xmllint.dtd_validation: true
xmllint.scheme_validation: true
xmllint.triggered_by: [xml]
xmllint.ignore_patterns:
# Uses an incomplete definition, which conflicts when <exclude-pattern>
# is defined.
- /^phpcs.xml$/
- /^phpmd.xml$/
- '#^files/.*\.xml$#'
- /^phpunit.xml$/
- /^pdepend.xml$/
- /^files/

yamllint.parse_constant: true

phpcs.standard: ./phpcs.xml
phpcs.triggered_by: [php]

phpmd.exclude: []
phpmd.ruleset:
- ./phpmd.xml
phpmd.triggered_by: [php]

phpstan.autoload_file: ~
phpstan.configuration: ./phpstan.neon
phpstan.level: 4
phpstan.triggered_by: [php]

phpunit.config_file: ./phpunit.xml

securitychecker.lockfile: ./composer.lock
securitychecker.format: ~
securitychecker.end_point: ~
securitychecker.timeout: ~
securitychecker.run_always: true

grumphp:

ascii:
failed: ~
succeeded: ~

parallel:
enabled: false

# Default tasks for testing suite
tasks:
composer:
strict: '%composer.strict%'

jsonlint:
detect_key_conflicts: '%jsonlint.detect_key_conflicts%'

xmllint:
load_from_net: '%xmllint.load_from_net%'
x_include: '%xmllint.x_include%'
dtd_validation: '%xmllint.dtd_validation%'
scheme_validation: '%xmllint.scheme_validation%'
triggered_by: '%xmllint.triggered_by%'
ignore_patterns: '%xmllint.ignore_patterns%'

yamllint:
parse_constant: '%yamllint.parse_constant%'

phpcs:
standard: '%phpcs.standard%'
triggered_by: '%phpcs.triggered_by%'

phpmd:
exclude: '%phpmd.exclude%'
ruleset: '%phpmd.ruleset%'
triggered_by: '%phpmd.triggered_by%'

phpstan:
autoload_file: '%phpstan.autoload_file%'
configuration: '%phpstan.configuration%'
level: '%phpstan.level%'
triggered_by: '%phpstan.triggered_by%'

phpunit:
config_file: '%phpunit.config_file%'

securitychecker:
lockfile: '%securitychecker.lockfile%'
format: '%securitychecker.format%'
end_point: '%securitychecker.end_point%'
timeout: '%securitychecker.timeout%'
run_always: '%securitychecker.run_always%'

24 changes: 24 additions & 0 deletions src/InstallerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,30 @@ public function activate(Composer $composer, IOInterface $inputOutput): void
{
}

/**
* Remove any hooks from Composer.
*
* @param Composer $composer
* @param IOInterface $io
*
* @return void
*/
public function deactivate(Composer $composer, IOInterface $io): void
{
}

/**
* Prepare the plugin to be uninstalled
*
* @param Composer $composer
* @param IOInterface $io
*
* @return void
*/
public function uninstall(Composer $composer, IOInterface $io): void
{
}

/**
* Get the subscribed events.
*
Expand Down
24 changes: 24 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,30 @@ public function activate(Composer $composer, IOInterface $inputOutput): void
{
}

/**
* Remove any hooks from Composer.
*
* @param Composer $composer
* @param IOInterface $io
*
* @return void
*/
public function deactivate(Composer $composer, IOInterface $io): void
{
}

/**
* Prepare the plugin to be uninstalled
*
* @param Composer $composer
* @param IOInterface $io
*
* @return void
*/
public function uninstall(Composer $composer, IOInterface $io): void
{
}

/**
* Get the subscribed events.
*
Expand Down

0 comments on commit 73278f2

Please sign in to comment.