Skip to content

Commit 2b91931

Browse files
Address remaining PHPCS issues
1 parent 045fd68 commit 2b91931

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
2+
3+
// phpcs:disable PEAR.NamingConventions.ValidClassName.StartWithCapital,PEAR.NamingConventions.ValidClassName.Invalid
24
/**
35
* phpstorm follows symlinks when indexing, which creates an infinite loop of indexing.
46
* The inclusion of the vendor folders is mostly the problem
57
*/
6-
78
class phpstorm_exclude_recursive_folders {
89

910
public static function init() {
@@ -87,8 +88,8 @@ protected static function get_project_iml_path() {
8788
$modules_xml = new DOMDocument();
8889
$modules_xml->load( '.idea/modules.xml' );
8990
$iml_file_path = $modules_xml->getElementsByTagName( 'component' )->item( 0 )
90-
->getElementsByTagName( 'modules' )->item( 0 )
91-
->getElementsByTagName( 'module' )->item( 0 )->getAttribute( 'filepath' );
91+
->getElementsByTagName( 'modules' )->item( 0 )
92+
->getElementsByTagName( 'module' )->item( 0 )->getAttribute( 'filepath' );
9293
$iml_file_path = str_replace( '$PROJECT_DIR$/', '', $iml_file_path );
9394

9495
return $iml_file_path;
@@ -120,10 +121,12 @@ protected static function get_exclude_dir_list() {
120121
* Add the folders to exclude in the iml file.
121122
*/
122123
protected static function set_exclude_in_project_iml() {
123-
$folders_to_exclude = self::get_exclude_dir_list();
124-
$iml_xml = new DOMDocument();
124+
$folders_to_exclude = self::get_exclude_dir_list();
125+
$iml_xml = new DOMDocument();
126+
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
125127
$iml_xml->preserveWhiteSpace = false;
126-
$iml_xml->formatOutput = true;
128+
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
129+
$iml_xml->formatOutput = true;
127130
$iml_xml->load( self::get_project_iml_path() );
128131
$iml_xml_content_node = $iml_xml->getElementsByTagName( 'component' )->item( 0 )
129132
->getElementsByTagName( 'content' )->item( 0 );
@@ -144,8 +147,10 @@ protected static function set_exclude_in_project_iml() {
144147
$iml_xml_content_node->appendChild( $exclude_node );
145148
}
146149

150+
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
147151
$iml_xml->preserveWhiteSpace = false;
148-
$iml_xml->formatOutput = true;
152+
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
153+
$iml_xml->formatOutput = true;
149154
$iml_xml->save( self::get_project_iml_path() );
150155
}
151156
}

.maintenance/src/Release_Date_Command.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ public function __invoke( $args, $assoc_args ) {
2626
$repo = "wp-cli/{$repo}";
2727
}
2828

29+
$has_v = 0 === strpos( $milestone_name, 'v' );
2930
$release = GitHub::get_release_by_tag(
3031
$repo,
31-
0 === strpos( $milestone_name, 'v' )
32+
$has_v
3233
? $milestone_name
3334
: "v{$milestone_name}",
3435
array( 'state' => 'all' )

phpcs.xml.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,11 @@
4545
SELECTIVE EXCLUSIONS
4646
#############################################################################
4747
-->
48+
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
49+
<exclude-pattern>*/.maintenance/*</exclude-pattern>
50+
</rule>
51+
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
52+
<exclude-pattern>*/.maintenance/*</exclude-pattern>
53+
</rule>
4854

4955
</ruleset>

0 commit comments

Comments
 (0)