Skip to content

Commit 51778d8

Browse files
committed
Fixed typos
1 parent 3ea45a4 commit 51778d8

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ import java.util.Map;
1717

1818
public class Main {
1919
public static void main(String[] args) throws Throwable {
20-
PHPJava phpjava = new PHPJava(false); // Determines if PHP errors should be ignored
21-
Map<String, String> env = new HashMap<>(); // Stores PHP global variables (e.g REQUEST_METHOD, etc...)
20+
JavaPHP javaphp = new JavaPHP(false);
21+
Map<String, String> env = new HashMap<>();
2222

2323
env.put("REQUEST_METHOD", "GET");
24-
25-
// Defines a lambda function that will be called each time an error occurs
26-
phpjava.setErrorCallback((error) -> System.out.println("ERROR: " + error));
27-
28-
phpjava.setPHPVars(env); // Gives the global variables to the PHP file
29-
phpjava.run(new File("./test.php").getAbsolutePath()); // Runs the PHP file
30-
31-
// Prints the result (HTML code if used with a webserver)
32-
System.out.println(phpjava.getResult());
24+
25+
javaphp.setErrorCallback((error) -> System.out.println("ERROR: " + error));
26+
27+
javaphp.setPHPVars(env);
28+
javaphp.run(new File("./test.php").getAbsolutePath());
29+
30+
System.out.println(javaphp.getResult());
3331
}
3432
}
3533
```

src/main/java/fr/breadeater/PHPJava.java renamed to src/main/java/fr/breadeater/JavaPHP.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.util.Map;
66
import java.util.function.Consumer;
77

8-
public class PHPJava {
8+
public class JavaPHP {
99
private final String PHP_BIN_PATH;
1010
private final boolean NO_PHP_WARN;
1111

@@ -18,7 +18,7 @@ public class PHPJava {
1818
* Creates a PHPJava instance
1919
* @param php_bin_path PHP binary file path (e.g /usr/bin/php)
2020
*/
21-
public PHPJava(String php_bin_path, boolean ignorePHPWarnings){
21+
public JavaPHP(String php_bin_path, boolean ignorePHPWarnings){
2222
this.PHP_BIN_PATH = php_bin_path;
2323
this.NO_PHP_WARN = ignorePHPWarnings;
2424
}
@@ -27,15 +27,15 @@ public PHPJava(String php_bin_path, boolean ignorePHPWarnings){
2727
* Creates a PHPJava instance
2828
* @param ignorePHPWarnings Specifies if PHP Warning and PHP Startup errors should be ignored
2929
*/
30-
public PHPJava(boolean ignorePHPWarnings){
30+
public JavaPHP(boolean ignorePHPWarnings){
3131
this.PHP_BIN_PATH = "php";
3232
this.NO_PHP_WARN = ignorePHPWarnings;
3333
}
3434

3535
/**
3636
* Creates a PHPJava instance
3737
*/
38-
public PHPJava(){
38+
public JavaPHP(){
3939
this.PHP_BIN_PATH = "php";
4040
this.NO_PHP_WARN = false;
4141
}
@@ -51,7 +51,7 @@ public void setPHPVars(Map<String, String> variables){
5151
}
5252

5353
/**
54-
* Runs the PHP file specified in the {@link PHPJava} constructor.<br><br>
54+
* Runs the PHP file specified in the {@link JavaPHP} constructor.<br><br>
5555
* The result can be retrieved with {@link #getResult()} function.
5656
*
5757
* @param php_filepath The file path of the PHP file to be executed.

src/main/java/fr/breadeater/Main.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
public class Main {
1212
public static void main(String[] args) throws Throwable {
1313
/*
14-
PHPJava phpjava = new PHPJava(false);
14+
JavaPHP javaphp = new JavaPHP(false);
1515
Map<String, String> env = new HashMap<>();
1616
1717
env.put("REQUEST_METHOD", "GET");
1818
19-
phpjava.setErrorCallback((error) -> System.out.println("ERROR: " + error));
19+
javaphp.setErrorCallback((error) -> System.out.println("ERROR: " + error));
2020
21-
phpjava.setPHPVars(env);
22-
phpjava.run(new File("./test.php").getAbsolutePath());
21+
javaphp.setPHPVars(env);
22+
javaphp.run(new File("./test.php").getAbsolutePath());
2323
24-
System.out.println(phpjava.getResult());
24+
System.out.println(javaphp.getResult());
2525
*/
2626
}
2727
}

0 commit comments

Comments
 (0)