Skip to content

Commit ac33ebf

Browse files
committed
Bugfixes.
1 parent d376576 commit ac33ebf

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

jphp-core/api-docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Compiler and Launcher for JPHP.
99

1010
### Install
1111
```
12-
12+
1313
```
1414

1515
### API

jphp-core/api-docs/README.ru.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Compiler and Launcher for JPHP.
99

1010
### Установка
1111
```
12-
12+
1313
```
1414

1515
### АПИ

jphp-runtime/api-docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Runtime for JPHP + Standard library.
99

1010
### Install
1111
```
12-
12+
1313
```
1414

1515
### API

jphp-runtime/api-docs/README.ru.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Runtime for JPHP + Standard library.
99

1010
### Установка
1111
```
12-
12+
1313
```
1414

1515
### АПИ

jphp-runtime/src/php/runtime/ext/core/MathFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class MathFunctions extends FunctionsContainer {
3838
}
3939

4040
for(int i = -MAX_SIN_NEG; i < MAX_SIN; i++){
41-
SIN_CACHE[i + MAX_SIN_NEG] = Math.cos(i);
41+
SIN_CACHE[i + MAX_SIN_NEG] = Math.sin(i);
4242
}
4343
}
4444

jphp-runtime/src/php/runtime/ext/support/Extension.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ public void registerNativeClass(CompileScope scope, Class<?> clazz) {
8383
}
8484

8585
public void registerClass(CompileScope scope, Class<?> clazz) {
86-
registerClass(scope, new Class[] { clazz });
86+
if (BaseWrapper.class.isAssignableFrom(clazz) && !clazz.isAnnotationPresent(Reflection.NotWrapper.class)) {
87+
throw new CriticalException("Please use registerWrapperClass() method instead of this for wrapper classes");
88+
}
89+
90+
if (this.classes.put(clazz.getName(), clazz) != null) {
91+
throw new CriticalException("Class already registered - " + clazz.getName());
92+
}
8793
}
8894

8995
public void registerClass(CompileScope scope, Class<?>... classes) {
9096
for (Class<?> clazz : classes) {
91-
if (BaseWrapper.class.isAssignableFrom(clazz) && !clazz.isAnnotationPresent(Reflection.NotWrapper.class)) {
92-
throw new CriticalException("Please use registerWrapperClass() method instead of this for wrapper classes");
93-
}
94-
95-
if (this.classes.put(clazz.getName(), clazz) != null) {
96-
throw new CriticalException("Class already registered - " + clazz.getName());
97-
}
97+
registerClass(scope, clazz);
9898
}
9999
}
100100

jphp-runtime/src/php/runtime/reflection/ModuleEntity.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public class ModuleEntity extends Entity {
3131

3232
protected boolean isLoaded;
3333

34-
private final static Memory[] argsMock = new Memory[]{};
34+
private final static Memory[] argsMock = Memory.CONST_EMPTY_ARRAY;
3535

3636
public ModuleEntity(Context context) {
3737
super(context);
38-
this.classes = new LinkedHashMap<String, ClassEntity>();
39-
this.functions = new ArrayList<FunctionEntity>();
40-
this.constants = new LinkedHashMap<String, ConstantEntity>();
41-
this.closures = new ArrayList<ClosureEntity>();
42-
this.generators = new ArrayList<GeneratorEntity>();
38+
this.classes = new LinkedHashMap<>();
39+
this.functions = new ArrayList<>();
40+
this.constants = new LinkedHashMap<>();
41+
this.closures = new ArrayList<>();
42+
this.generators = new ArrayList<>();
4343
this.setName(context.getModuleNameNoThrow());
4444
}
4545

0 commit comments

Comments
 (0)