Skip to content

Commit 2da20b0

Browse files
committed
Added valueRestrictions to null and void Type
1 parent f19b5fd commit 2da20b0

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

src/type/NeverType.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
declare(strict_types = 1);
33
namespace TimoLehnertz\formula\type;
44

5-
use TimoLehnertz\formula\nodes\NodeInterfaceType;
65
use TimoLehnertz\formula\operator\ImplementableOperator;
76

87
/**
@@ -26,10 +25,6 @@ public function getIdentifier(bool $isNested = false): string {
2625
return 'never';
2726
}
2827

29-
// public function getImplementedOperators(): array {
30-
// return [];
31-
// }
32-
3328
protected function getTypeOperatorResultType(ImplementableOperator $operator, ?Type $otherType): ?Type {
3429
return null;
3530
}

src/type/NullType.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TimoLehnertz\formula\type;
66

7-
use TimoLehnertz\formula\nodes\NodeInterfaceType;
87
use TimoLehnertz\formula\operator\ImplementableOperator;
98

109
/**
@@ -13,7 +12,7 @@
1312
class NullType extends Type {
1413

1514
public function __construct() {
16-
parent::__construct();
15+
parent::__construct([new NullValue()]);
1716
}
1817

1918
protected function typeAssignableBy(Type $type): bool {
@@ -28,10 +27,6 @@ public function getIdentifier(bool $isNested = false): string {
2827
return 'null';
2928
}
3029

31-
// public function getImplementedOperators(): array {
32-
// return [];
33-
// }
34-
3530
protected function getTypeCompatibleOperands(ImplementableOperator $operator): array {
3631
return [];
3732
}

src/type/VoidType.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class VoidType extends Type {
1111

1212
public function __construct() {
13-
parent::__construct();
13+
parent::__construct([new VoidValue()]);
1414
}
1515

1616
public function getIdentifier(bool $nested = false): string {
@@ -25,10 +25,6 @@ public function equals(Type $type): bool {
2525
return $type instanceof VoidType;
2626
}
2727

28-
// public function getImplementedOperators(): array {
29-
// return [];
30-
// }
31-
3228
protected function getTypeCompatibleOperands(ImplementableOperator $operator): array {
3329
return [];
3430
}

0 commit comments

Comments
 (0)