forked from Automattic/phpcs-diff
-
Notifications
You must be signed in to change notification settings - Fork 3
/
phpcs-diff.php
executable file
·32 lines (27 loc) · 962 Bytes
/
phpcs-diff.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/*
Plugin Name: PHPCS Diff
Plugin URI: https://github.com/Automattic/phpcs-diff
Description: Add WP-CLI command for generating PHP CodeSniffer reports for diff retrieved from version systems
Version: 0.0.1
Author: Automattic
Author URI: https://automattic.com/
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: phpcs_diff
Domain Path: /languages
*/
require_once 'vendor/autoload.php';
if ( ! defined( 'PHPCS_DIFF_PLUGIN_DIR' ) ) {
define( 'PHPCS_DIFF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
if( ! defined( 'PHPCS_DIFF_COMMAND' ) ) {
define( 'PHPCS_DIFF_COMMAND', PHPCS_DIFF_PLUGIN_DIR . 'vendor/bin/phpcs' );
}
if( ! defined( 'PHPCS_DIFF_STANDARDS' ) ) {
define( 'PHPCS_DIFF_STANDARDS', PHPCS_DIFF_PLUGIN_DIR . 'standards' );
}
// Load the command only if we're running WordPress via WP CLI.
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once( PHPCS_DIFF_PLUGIN_DIR . 'wp-cli-command.php' );
}