Skip to content

Commit 87ccd5f

Browse files
Auto-fix a variety of phpcs issues with phpcbf
1 parent 70548cb commit 87ccd5f

11 files changed

+293
-248
lines changed

.maintenance/clone-all-repositories.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@
1212
'wp-cli-roadmap',
1313
);
1414

15-
$request = 'https://api.github.com/orgs/wp-cli/repos?per_page=100';
16-
$headers = '';
17-
$token = getenv( 'GITHUB_TOKEN' );
18-
if (!empty($token)) {
19-
$headers = '--header "Authorization: token $token"';
20-
$response = shell_exec( "curl -s {$headers} {$request}" );
15+
$request = 'https://api.github.com/orgs/wp-cli/repos?per_page=100';
16+
$headers = '';
17+
$token = getenv( 'GITHUB_TOKEN' );
18+
if ( ! empty( $token ) ) {
19+
$headers = '--header "Authorization: token $token"';
20+
$response = shell_exec( "curl -s {$headers} {$request}" );
21+
} else {
22+
$response = shell_exec( "curl -s {$request}" );
2123
}
22-
else
23-
{
24-
$response = shell_exec( "curl -s {$request}" );
25-
}
26-
$repositories = json_decode( $response );
24+
$repositories = json_decode( $response );
2725
if ( ! is_array( $repositories ) && property_exists( $repositories, 'message' ) ) {
28-
echo "GitHub responded with: " . $repositories->message . "\n";
26+
echo 'GitHub responded with: ' . $repositories->message . "\n";
2927
echo "If you are running into a rate limiting issue during large events please set GITHUB_TOKEN environment variable.\n";
3028
exit( 1 );
3129
}

.maintenance/phpstorm.exclude-recursive-folders.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected static function has_project_iml() {
7474
*/
7575
protected static function get_project_name() {
7676
$pwd = getcwd();
77-
$project_name = substr( $pwd, strrpos( $pwd, "/" ) + 1 );
77+
$project_name = substr( $pwd, strrpos( $pwd, '/' ) + 1 );
7878

7979
return $project_name;
8080
}
@@ -87,8 +87,8 @@ protected static function get_project_iml_path() {
8787
$modules_xml = new DOMDocument();
8888
$modules_xml->load( '.idea/modules.xml' );
8989
$iml_file_path = $modules_xml->getElementsByTagName( 'component' )->item( 0 )
90-
->getElementsByTagName( 'modules' )->item( 0 )
91-
->getElementsByTagName( 'module' )->item( 0 )->getAttribute( 'filepath' );
90+
->getElementsByTagName( 'modules' )->item( 0 )
91+
->getElementsByTagName( 'module' )->item( 0 )->getAttribute( 'filepath' );
9292
$iml_file_path = str_replace( '$PROJECT_DIR$/', '', $iml_file_path );
9393

9494
return $iml_file_path;
@@ -126,7 +126,7 @@ protected static function set_exclude_in_project_iml() {
126126
$iml_xml->formatOutput = true;
127127
$iml_xml->load( self::get_project_iml_path() );
128128
$iml_xml_content_node = $iml_xml->getElementsByTagName( 'component' )->item( 0 )
129-
->getElementsByTagName( 'content' )->item( 0 );
129+
->getElementsByTagName( 'content' )->item( 0 );
130130
$xpath = new DomXpath( $iml_xml );
131131

132132
foreach ( $folders_to_exclude as $folder ) {

.maintenance/refresh-repository.php

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

3-
if ( ! isset ( $argv[1] ) || ! is_dir( $argv[1] ) ) {
3+
if ( ! isset( $argv[1] ) || ! is_dir( $argv[1] ) ) {
44
exit( "Usage: php refresh-repository.php <repository-folder>\n" );
55
}
66

77
$repository = $argv[1];
8-
$path = realpath( getcwd() . "/{$repository}" );
8+
$path = realpath( getcwd() . "/{$repository}" );
99

1010
printf( "--- Refreshing repository \033[32m{$repository}\033[0m ---\n" );
1111

0 commit comments

Comments
 (0)