Skip to content

Commit d2eb8cf

Browse files
committed
Introduce the newInstance static factory method
1 parent cff0c15 commit d2eb8cf

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/org/netbeans/modules/php/wordpress/commands/WordPressCli.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,16 @@ private WordPressCli(String wpCliPath) {
116116
this.wpCliPath = wpCliPath;
117117
}
118118

119+
public static WordPressCli getDefault(boolean warn) throws InvalidPhpExecutableException {
120+
String wpCliPath = WordPressOptions.getInstance().getWpCliPath();
121+
return newInstance(wpCliPath, warn);
122+
}
123+
119124
@NbBundle.Messages({
120125
"# {0} - error message",
121126
"WordPressCli.invalid.wpcli.script=<html>wp-cli is not valid.<br>({0})"
122127
})
123-
public static WordPressCli getDefault(boolean warn) throws InvalidPhpExecutableException {
124-
String wpCliPath = WordPressOptions.getInstance().getWpCliPath();
128+
public static WordPressCli newInstance(String wpCliPath, boolean warn) throws InvalidPhpExecutableException {
125129
String error = validate(wpCliPath);
126130
if (error == null) {
127131
return new WordPressCli(wpCliPath);

0 commit comments

Comments
 (0)