Skip to content

Commit

Permalink
Fix coding standards issues and make plugin fully translatable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Arntz committed Jan 15, 2018
1 parent eb91036 commit 40a4c65
Show file tree
Hide file tree
Showing 7 changed files with 336 additions and 229 deletions.
13 changes: 11 additions & 2 deletions load-files.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?php
// Exit if this file is directly accessed
if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* Dependency loader
*
* @package WPEngine\PHPCompat
* @since 1.0.0
*/

// Exit if this file is directly accessed.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Loads the plugin files.
Expand Down
10 changes: 9 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>

<rule ref="WordPress"/>
<rule ref="WordPress">
<exclude name="WordPress.Files.FileName"/>
</rule>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="string" value="php-compatibility-checker"/>
</properties>
</rule>

<rule ref="WordPress.NamingConventions.ValidVariableName">
<properties>
<property name="customPropertiesWhitelist" type="string" value="Name"/>
</properties>
</rule>

<config name="testVersion" value="5.2-99.0"/>
<rule ref="PHPCompatibility"/>
</ruleset>
16 changes: 15 additions & 1 deletion src/ruleset-wordpress.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
<description>WordPress-Core Custom</description>

<!-- Include WordPress-Core standards. -->
<rule ref="WordPress-Core"/>
<rule ref="WordPress-Core">
<exclude name="WordPress.Files.FileName"/>
</rule>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="string" value="php-compatibility-checker"/>
</properties>
</rule>

<rule ref="WordPress.NamingConventions.ValidVariableName">
<properties>
<property name="customPropertiesWhitelist" type="string" value="Name"/>
</properties>
</rule>

</ruleset>
9 changes: 8 additions & 1 deletion src/wpcli.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php
/**
* PHPCompat_Command class
*
* @package WPEngine\PHPCompat
* @since 1.0.0
*/

require_once dirname( dirname( __FILE__ ) ) . '/load-files.php';

/**
Expand Down Expand Up @@ -60,7 +67,7 @@ function __invoke( $args, $assoc_args ) {
*/
WP_CLI::add_command( 'phpcompat', 'PHPCompat_Command', array(
'shortdesc' => 'Test compatibility with different PHP versions.',
'synopsis' => array(
'synopsis' => array(
array(
'type' => 'positional',
'name' => 'version',
Expand Down
Loading

0 comments on commit 40a4c65

Please # to comment.