Skip to content

Commit bf079e7

Browse files
committed
Use short array notation
1 parent 7083b07 commit bf079e7

File tree

6 files changed

+33
-33
lines changed

6 files changed

+33
-33
lines changed

utils/maintenance/Contrib_List_Command.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public function __invoke( $_, $assoc_args ) {
6969
$composer_json = json_decode( $response->body, true );
7070

7171
// TODO: Only need for initial v2.
72-
$composer_json['packages'][] = array(
72+
$composer_json['packages'][] = [
7373
'name' => 'wp-cli/i18n-command',
7474
'version' => 'v2',
75-
);
75+
];
7676
usort(
7777
$composer_json['packages'],
7878
function ( $a, $b ) {
@@ -86,22 +86,22 @@ function ( $a, $b ) {
8686
if ( ! preg_match( '#^wp-cli/.+-command$#', $package_name )
8787
&& ! in_array(
8888
$package_name,
89-
array(
89+
[
9090
'wp-cli/wp-cli-tests',
9191
'wp-cli/regenerate-readme',
9292
'wp-cli/autoload-splitter',
9393
'wp-cli/wp-config-transformer',
9494
'wp-cli/php-cli-tools',
9595
'wp-cli/spyc',
96-
),
96+
],
9797
true
9898
) ) {
9999
continue;
100100
}
101101
// Closed milestones denote a tagged release
102102
$milestones = GitHub::get_project_milestones( $package_name, [ 'state' => 'closed' ] );
103-
$milestone_ids = array();
104-
$milestone_titles = array();
103+
$milestone_ids = [];
104+
$milestone_titles = [];
105105
foreach ( $milestones as $milestone ) {
106106
if ( ! version_compare( $milestone->title, $version_constraint, '>' ) ) {
107107
continue;

utils/maintenance/Milestones_After_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __invoke( $args, $assoc_args ) {
2929
$milestones = array_filter(
3030
GitHub::get_project_milestones(
3131
$repo,
32-
array( 'state' => 'closed' )
32+
[ 'state' => 'closed' ]
3333
),
3434
function ( $milestone ) use (
3535
$milestone_name,

utils/maintenance/Milestones_Since_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __invoke( $args, $assoc_args ) {
3232
$milestones = array_filter(
3333
GitHub::get_project_milestones(
3434
$repo,
35-
array( 'state' => 'closed' )
35+
[ 'state' => 'closed' ]
3636
),
3737
function ( $milestone ) use ( $date ) {
3838
$closed = new DateTime( $milestone->closed_at );

utils/maintenance/Release_Date_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __invoke( $args, $assoc_args ) {
3131
strpos( $milestone_name, 'v' ) === 0
3232
? $milestone_name
3333
: "v{$milestone_name}",
34-
array( 'state' => 'all' )
34+
[ 'state' => 'all' ]
3535
);
3636

3737
WP_CLI::log( $release->published_at );

utils/maintenance/Release_Notes_Command.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ public function __invoke( $args, $assoc_args ) {
6969
private function get_bundle_release_notes( $source, $format ) {
7070
// Get the release notes for the current open large project milestones.
7171
foreach (
72-
array(
72+
[
7373
'wp-cli/wp-cli-bundle',
7474
'wp-cli/wp-cli',
7575
'wp-cli/handbook',
7676
'wp-cli/wp-cli.github.com',
77-
) as $repo
77+
] as $repo
7878
) {
7979
$milestones = GitHub::get_project_milestones( $repo );
8080
// Cheap way to get the latest milestone
@@ -100,7 +100,7 @@ private function get_bundle_release_notes( $source, $format ) {
100100

101101
$milestones = GitHub::get_project_milestones(
102102
'wp-cli/wp-cli',
103-
array( 'state' => 'closed' )
103+
[ 'state' => 'closed' ]
104104
);
105105
// Cheap way to get the latest closed milestone
106106
$milestone = array_shift( $milestones );
@@ -128,10 +128,10 @@ private function get_bundle_release_notes( $source, $format ) {
128128
$composer_json = json_decode( $response->body, true );
129129

130130
// TODO: Only need for initial v2.
131-
$composer_json['packages'][] = array(
131+
$composer_json['packages'][] = [
132132
'name' => 'wp-cli/i18n-command',
133133
'version' => 'v2',
134-
);
134+
];
135135
usort(
136136
$composer_json['packages'],
137137
function ( $a, $b ) {
@@ -145,14 +145,14 @@ function ( $a, $b ) {
145145
if ( ! preg_match( '#^wp-cli/.+-command$#', $package_name )
146146
&& ! in_array(
147147
$package_name,
148-
array(
148+
[
149149
'wp-cli/wp-cli-tests',
150150
'wp-cli/regenerate-readme',
151151
'wp-cli/autoload-splitter',
152152
'wp-cli/wp-config-transformer',
153153
'wp-cli/php-cli-tools',
154154
'wp-cli/spyc',
155-
),
155+
],
156156
true
157157
) ) {
158158
continue;
@@ -163,7 +163,7 @@ function ( $a, $b ) {
163163
// Closed milestones denote a tagged release
164164
$milestones = GitHub::get_project_milestones(
165165
$package_name,
166-
array( 'state' => 'closed' )
166+
[ 'state' => 'closed' ]
167167
);
168168
foreach ( $milestones as $milestone ) {
169169
if ( ! version_compare(
@@ -198,10 +198,10 @@ private function get_repo_release_notes(
198198

199199
$potential_milestones = GitHub::get_project_milestones(
200200
$repo,
201-
array( 'state' => 'all' )
201+
[ 'state' => 'all' ]
202202
);
203203

204-
$milestones = array();
204+
$milestones = [];
205205
foreach ( $potential_milestones as $potential_milestone ) {
206206
if ( in_array(
207207
$potential_milestone->title,
@@ -228,7 +228,7 @@ private function get_repo_release_notes(
228228
);
229229
}
230230

231-
$entries = array();
231+
$entries = [];
232232
foreach ( $milestones as $milestone ) {
233233
switch ( $source ) {
234234
case 'release':
@@ -239,7 +239,7 @@ private function get_repo_release_notes(
239239
$release = GitHub::get_release_by_tag(
240240
$repo,
241241
$tag,
242-
array( 'throw_errors' => false )
242+
[ 'throw_errors' => false ]
243243
);
244244

245245
if ( $release ) {

utils/make-phar-spec.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<?php
22

3-
return array(
4-
'output' => array(
3+
return [
4+
'output' => [
55
'runtime' => '=<path>',
66
'file' => '<path>',
77
'desc' => 'Path to output file',
8-
),
8+
],
99

10-
'version' => array(
10+
'version' => [
1111
'runtime' => '=<version>',
1212
'file' => '<version>',
1313
'desc' => 'New package version',
14-
),
14+
],
1515

16-
'store-version' => array(
16+
'store-version' => [
1717
'runtime' => '',
1818
'file' => '<bool>',
1919
'default' => false,
2020
'desc' => 'If true the contents of ./VERSION will be set to the value passed to --version',
21-
),
21+
],
2222

23-
'quiet' => array(
23+
'quiet' => [
2424
'runtime' => '',
2525
'file' => '<bool>',
2626
'default' => false,
2727
'desc' => 'Suppress informational messages',
28-
),
28+
],
2929

30-
'build' => array(
30+
'build' => [
3131
'runtime' => '=<cli>',
3232
'file' => '<cli>',
3333
'default' => '',
3434
'desc' => 'Create a minimum test build "cli", that only supports cli commands',
35-
),
36-
);
35+
],
36+
];
3737

0 commit comments

Comments
 (0)