Skip to content

Commit 40a4c65

Browse files
author
Felix Arntz
committed
Fix coding standards issues and make plugin fully translatable.
1 parent eb91036 commit 40a4c65

7 files changed

+336
-229
lines changed

Diff for: load-files.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<?php
2-
// Exit if this file is directly accessed
3-
if ( ! defined( 'ABSPATH' ) ) { exit; }
2+
/**
3+
* Dependency loader
4+
*
5+
* @package WPEngine\PHPCompat
6+
* @since 1.0.0
7+
*/
8+
9+
// Exit if this file is directly accessed.
10+
if ( ! defined( 'ABSPATH' ) ) {
11+
exit;
12+
}
413

514
/**
615
* Loads the plugin files.

Diff for: phpcs.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@
55
<exclude-pattern>*/tests/*</exclude-pattern>
66
<exclude-pattern>*/vendor/*</exclude-pattern>
77

8-
<rule ref="WordPress"/>
8+
<rule ref="WordPress">
9+
<exclude name="WordPress.Files.FileName"/>
10+
</rule>
911

1012
<rule ref="WordPress.WP.I18n">
1113
<properties>
1214
<property name="text_domain" type="string" value="php-compatibility-checker"/>
1315
</properties>
1416
</rule>
1517

18+
<rule ref="WordPress.NamingConventions.ValidVariableName">
19+
<properties>
20+
<property name="customPropertiesWhitelist" type="string" value="Name"/>
21+
</properties>
22+
</rule>
23+
1624
<config name="testVersion" value="5.2-99.0"/>
1725
<rule ref="PHPCompatibility"/>
1826
</ruleset>

Diff for: src/ruleset-wordpress.xml

+15-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
<description>WordPress-Core Custom</description>
55

66
<!-- Include WordPress-Core standards. -->
7-
<rule ref="WordPress-Core"/>
7+
<rule ref="WordPress-Core">
8+
<exclude name="WordPress.Files.FileName"/>
9+
</rule>
10+
11+
<rule ref="WordPress.WP.I18n">
12+
<properties>
13+
<property name="text_domain" type="string" value="php-compatibility-checker"/>
14+
</properties>
15+
</rule>
16+
17+
<rule ref="WordPress.NamingConventions.ValidVariableName">
18+
<properties>
19+
<property name="customPropertiesWhitelist" type="string" value="Name"/>
20+
</properties>
21+
</rule>
822

923
</ruleset>

Diff for: src/wpcli.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php
2+
/**
3+
* PHPCompat_Command class
4+
*
5+
* @package WPEngine\PHPCompat
6+
* @since 1.0.0
7+
*/
8+
29
require_once dirname( dirname( __FILE__ ) ) . '/load-files.php';
310

411
/**
@@ -60,7 +67,7 @@ function __invoke( $args, $assoc_args ) {
6067
*/
6168
WP_CLI::add_command( 'phpcompat', 'PHPCompat_Command', array(
6269
'shortdesc' => 'Test compatibility with different PHP versions.',
63-
'synopsis' => array(
70+
'synopsis' => array(
6471
array(
6572
'type' => 'positional',
6673
'name' => 'version',

0 commit comments

Comments
 (0)