Skip to content

Commit 856a781

Browse files
committed
Adding possibility to set properties of the PHPCS_Diff class via options passed to constructor
1 parent 2ec6589 commit 856a781

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

class-phpcs-diff.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ class PHPCS_Diff {
2020

2121
private $no_diff_to_big = false;
2222

23-
public function __construct( $version_control ) {
23+
public function __construct( $version_control, $options = array() ) {
24+
25+
if ( true === is_array( $options ) && false === empty( $options ) ) {
26+
foreach( $options as $option => $value ) {
27+
$this->$option = $value;
28+
}
29+
}
2430

2531
$this->version_control = $version_control;
2632

0 commit comments

Comments
 (0)