Skip to content

Commit b56968d

Browse files
committed
Adding constants for allowing users to set configuration w/o need to modify files in order to properly setup PHPCS and SVN
1 parent 5091698 commit b56968d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

class-phpcs-diff-svn.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ class PHPCS_Diff_SVN {
1212

1313
function __construct( $repo, $options = array() ) {
1414

15+
if ( true === defined( 'PHPCS_DIFF_SVN_USERNAME' ) ) {
16+
$this->svn_username = PHPCS_DIFF_SVN_USERNAME;
17+
}
18+
if ( true === defined( 'PHPCS_DIFF_SVN_PASSWORD' ) ) {
19+
$this->svn_password = PHPCS_DIFF_SVN_PASSWORD;
20+
}
21+
1522
if ( true === is_array( $options ) && false === empty( $options ) ) {
1623
foreach( $options as $option => $value ) {
1724
$this->$option = $value;

class-phpcs-diff.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ class PHPCS_Diff {
2222

2323
public function __construct( $version_control, $options = array() ) {
2424

25+
if ( true === defined( 'PHPCS_DIFF_COMMAND' ) && false === empty( PHPCS_DIFF_COMMAND ) ) {
26+
$this->phpcs_command = PHPCS_DIFF_COMMAND;
27+
}
28+
if ( true === defined( 'PHPCS_DIFF_STANDARDS' ) && false === empty( PHPCS_DIFF_STANDARDS ) ) {
29+
$this->standards_location = PHPCS_DIFF_STANDARDS;
30+
}
31+
2532
if ( true === is_array( $options ) && false === empty( $options ) ) {
2633
foreach( $options as $option => $value ) {
2734
$this->$option = $value;

0 commit comments

Comments
 (0)