|
5 | 5 |
|
6 | 6 | final class Release_Notes_Command { |
7 | 7 |
|
| 8 | + /** |
| 9 | + * Packages excluded from contributor list generation. |
| 10 | + * @var array |
| 11 | + */ |
| 12 | + private $excluded_packages = [ |
| 13 | + 'wp-cli/wp-cli-tests', |
| 14 | + 'wp-cli/regenerate-readme', |
| 15 | + 'wp-cli/autoload-splitter', |
| 16 | + 'wp-cli/wp-config-transformer', |
| 17 | + 'wp-cli/php-cli-tools', |
| 18 | + 'wp-cli/spyc', |
| 19 | + ]; |
| 20 | + |
| 21 | + /** |
| 22 | + * Higher-level packages that represent the principal project building |
| 23 | + * blocks. |
| 24 | + * |
| 25 | + * @var array |
| 26 | + */ |
| 27 | + private $higher_level_packages = [ |
| 28 | + 'wp-cli/wp-cli-bundle', |
| 29 | + 'wp-cli/wp-cli', |
| 30 | + 'wp-cli/handbook', |
| 31 | + 'wp-cli/wp-cli.github.com', |
| 32 | + ]; |
| 33 | + |
8 | 34 | /** |
9 | 35 | * Gets the release notes for one or more milestones of a repository. |
10 | 36 | * |
@@ -68,14 +94,7 @@ public function __invoke( $args, $assoc_args ) { |
68 | 94 |
|
69 | 95 | private function get_bundle_release_notes( $source, $format ) { |
70 | 96 | // Get the release notes for the current open large project milestones. |
71 | | - foreach ( |
72 | | - [ |
73 | | - 'wp-cli/wp-cli-bundle', |
74 | | - 'wp-cli/wp-cli', |
75 | | - 'wp-cli/handbook', |
76 | | - 'wp-cli/wp-cli.github.com', |
77 | | - ] as $repo |
78 | | - ) { |
| 97 | + foreach ( $this->higher_level_packages as $repo ) { |
79 | 98 | $milestones = GitHub::get_project_milestones( $repo ); |
80 | 99 | // Cheap way to get the latest milestone |
81 | 100 | $milestone = array_shift( $milestones ); |
@@ -143,18 +162,7 @@ function ( $a, $b ) { |
143 | 162 | $package_name = $package['name']; |
144 | 163 | $version_constraint = str_replace( 'v', '', $package['version'] ); |
145 | 164 | if ( ! preg_match( '#^wp-cli/.+-command$#', $package_name ) |
146 | | - && ! in_array( |
147 | | - $package_name, |
148 | | - [ |
149 | | - 'wp-cli/wp-cli-tests', |
150 | | - 'wp-cli/regenerate-readme', |
151 | | - 'wp-cli/autoload-splitter', |
152 | | - 'wp-cli/wp-config-transformer', |
153 | | - 'wp-cli/php-cli-tools', |
154 | | - 'wp-cli/spyc', |
155 | | - ], |
156 | | - true |
157 | | - ) ) { |
| 165 | + && ! in_array( $package_name, $this->excluded_packages, true ) ) { |
158 | 166 | continue; |
159 | 167 | } |
160 | 168 |
|
|
0 commit comments