Skip to content

Commit 73278f2

Browse files
authored
Merge pull request #18 from mediact/feature/composer-2-compatibility
Feature/composer 2 compatibility
2 parents cdefad9 + b77e2bb commit 73278f2

File tree

4 files changed

+143
-8
lines changed

4 files changed

+143
-8
lines changed

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
"email": "[email protected]"
1010
}
1111
],
12-
"version": "2.1.0",
1312
"require": {
1413
"php": "^7.1",
15-
"composer-plugin-api": "^1.0"
14+
"composer-plugin-api": "^1.0 || ^2.0"
1615
},
1716
"require-dev": {
1817
"phpunit/phpunit": "^7.5",
19-
"composer/composer": "^1.3",
18+
"composer/composer": "^1.3 || ^2.0",
2019
"kint-php/kint": "@stable",
21-
"mediact/testing-suite": "^2.0",
20+
"mediact/coding-standard": "@stable",
21+
"phpro/grumphp": ">=0.19 <1.0",
22+
"phpstan/phpstan": "@stable",
23+
"sensiolabs/security-checker": "@stable",
2224
"mikey179/vfsstream": "^1.6"
2325
},
2426
"autoload": {

grumphp.yml

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,96 @@
1-
imports:
2-
- resource: 'vendor/mediact/testing-suite/config/default/grumphp.yml'
3-
41
parameters:
2+
# Default settings for testing suite tasks
53
composer.strict: false
4+
5+
jsonlint.detect_key_conflicts: true
6+
7+
xmllint.load_from_net: true
8+
xmllint.x_include: true
9+
xmllint.dtd_validation: true
10+
xmllint.scheme_validation: true
11+
xmllint.triggered_by: [xml]
612
xmllint.ignore_patterns:
713
# Uses an incomplete definition, which conflicts when <exclude-pattern>
814
# is defined.
915
- /^phpcs.xml$/
1016
- /^phpmd.xml$/
11-
- '#^files/.*\.xml$#'
17+
- /^phpunit.xml$/
18+
- /^pdepend.xml$/
19+
- /^files/
20+
21+
yamllint.parse_constant: true
22+
23+
phpcs.standard: ./phpcs.xml
24+
phpcs.triggered_by: [php]
25+
26+
phpmd.exclude: []
27+
phpmd.ruleset:
28+
- ./phpmd.xml
29+
phpmd.triggered_by: [php]
30+
31+
phpstan.autoload_file: ~
32+
phpstan.configuration: ./phpstan.neon
33+
phpstan.level: 4
34+
phpstan.triggered_by: [php]
35+
36+
phpunit.config_file: ./phpunit.xml
37+
38+
securitychecker.lockfile: ./composer.lock
39+
securitychecker.format: ~
40+
securitychecker.end_point: ~
41+
securitychecker.timeout: ~
42+
securitychecker.run_always: true
43+
44+
grumphp:
45+
46+
ascii:
47+
failed: ~
48+
succeeded: ~
49+
50+
parallel:
51+
enabled: false
52+
53+
# Default tasks for testing suite
54+
tasks:
55+
composer:
56+
strict: '%composer.strict%'
57+
58+
jsonlint:
59+
detect_key_conflicts: '%jsonlint.detect_key_conflicts%'
60+
61+
xmllint:
62+
load_from_net: '%xmllint.load_from_net%'
63+
x_include: '%xmllint.x_include%'
64+
dtd_validation: '%xmllint.dtd_validation%'
65+
scheme_validation: '%xmllint.scheme_validation%'
66+
triggered_by: '%xmllint.triggered_by%'
67+
ignore_patterns: '%xmllint.ignore_patterns%'
68+
69+
yamllint:
70+
parse_constant: '%yamllint.parse_constant%'
71+
72+
phpcs:
73+
standard: '%phpcs.standard%'
74+
triggered_by: '%phpcs.triggered_by%'
75+
76+
phpmd:
77+
exclude: '%phpmd.exclude%'
78+
ruleset: '%phpmd.ruleset%'
79+
triggered_by: '%phpmd.triggered_by%'
80+
81+
phpstan:
82+
autoload_file: '%phpstan.autoload_file%'
83+
configuration: '%phpstan.configuration%'
84+
level: '%phpstan.level%'
85+
triggered_by: '%phpstan.triggered_by%'
86+
87+
phpunit:
88+
config_file: '%phpunit.config_file%'
89+
90+
securitychecker:
91+
lockfile: '%securitychecker.lockfile%'
92+
format: '%securitychecker.format%'
93+
end_point: '%securitychecker.end_point%'
94+
timeout: '%securitychecker.timeout%'
95+
run_always: '%securitychecker.run_always%'
96+

src/InstallerPlugin.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,30 @@ public function activate(Composer $composer, IOInterface $inputOutput): void
5050
{
5151
}
5252

53+
/**
54+
* Remove any hooks from Composer.
55+
*
56+
* @param Composer $composer
57+
* @param IOInterface $io
58+
*
59+
* @return void
60+
*/
61+
public function deactivate(Composer $composer, IOInterface $io): void
62+
{
63+
}
64+
65+
/**
66+
* Prepare the plugin to be uninstalled
67+
*
68+
* @param Composer $composer
69+
* @param IOInterface $io
70+
*
71+
* @return void
72+
*/
73+
public function uninstall(Composer $composer, IOInterface $io): void
74+
{
75+
}
76+
5377
/**
5478
* Get the subscribed events.
5579
*

src/Plugin.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,30 @@ public function activate(Composer $composer, IOInterface $inputOutput): void
5656
{
5757
}
5858

59+
/**
60+
* Remove any hooks from Composer.
61+
*
62+
* @param Composer $composer
63+
* @param IOInterface $io
64+
*
65+
* @return void
66+
*/
67+
public function deactivate(Composer $composer, IOInterface $io): void
68+
{
69+
}
70+
71+
/**
72+
* Prepare the plugin to be uninstalled
73+
*
74+
* @param Composer $composer
75+
* @param IOInterface $io
76+
*
77+
* @return void
78+
*/
79+
public function uninstall(Composer $composer, IOInterface $io): void
80+
{
81+
}
82+
5983
/**
6084
* Get the subscribed events.
6185
*

0 commit comments

Comments
 (0)