Skip to content

Commit 2b81ca9

Browse files
committed
Adapt Composer setup
1 parent d0b7d21 commit 2b81ca9

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

composer.json

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,40 @@
2121
"files": [ "scaffold-package-command.php" ]
2222
},
2323
"require": {
24-
"wp-cli/scaffold-command": "*"
24+
"php": "^5.6 || ^7.0",
25+
"wp-cli/wp-cli": "^2",
26+
"wp-cli/scaffold-command": "^2"
2527
},
2628
"require-dev": {
27-
"wp-cli/wp-cli": "*",
28-
"behat/behat": "~2.5"
29+
"wp-cli/wp-cli-tests": "^2.1"
30+
},
31+
"config": {
32+
"process-timeout": 7200,
33+
"sort-packages": true
2934
},
3035
"extra": {
3136
"branch-alias": {
32-
"dev-master": "1.x-dev"
37+
"dev-master": "2.x-dev"
3338
},
3439
"commands": [
3540
"scaffold package",
3641
"scaffold package-tests",
3742
"scaffold package-readme",
3843
"scaffold package-github"
3944
]
45+
},
46+
"scripts": {
47+
"behat": "run-behat-tests",
48+
"behat-rerun": "rerun-behat-tests",
49+
"lint": "run-linter-tests",
50+
"phpcs": "run-phpcs-tests",
51+
"phpunit": "run-php-unit-tests",
52+
"prepare-tests": "install-package-tests",
53+
"test": [
54+
"@lint",
55+
"@phpcs",
56+
"@phpunit",
57+
"@behat"
58+
]
4059
}
4160
}

scaffold-package-command.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use WP_CLI\ScaffoldPackageCommand;
4+
35
if ( ! class_exists( 'WP_CLI' ) ) {
46
return;
57
}
@@ -9,7 +11,7 @@
911
require_once $autoload;
1012
}
1113

12-
WP_CLI::add_command( 'scaffold package', array( 'WP_CLI\ScaffoldPackageCommand', 'package' ) );
13-
WP_CLI::add_command( 'scaffold package-readme', array( 'WP_CLI\ScaffoldPackageCommand', 'package_readme' ) );
14-
WP_CLI::add_command( 'scaffold package-tests', array( 'WP_CLI\ScaffoldPackageCommand', 'package_tests' ) );
15-
WP_CLI::add_command( 'scaffold package-github', array( 'WP_CLI\ScaffoldPackageCommand', 'package_github' ) );
14+
WP_CLI::add_command( 'scaffold package', [ ScaffoldPackageCommand::class, 'package' ] );
15+
WP_CLI::add_command( 'scaffold package-readme', [ ScaffoldPackageCommand::class, 'package_readme' ] );
16+
WP_CLI::add_command( 'scaffold package-tests', [ ScaffoldPackageCommand::class, 'package_tests' ] );
17+
WP_CLI::add_command( 'scaffold package-github', [ ScaffoldPackageCommand::class, 'package_github' ] );

0 commit comments

Comments
 (0)