File tree Expand file tree Collapse file tree 7 files changed +66
-49
lines changed Expand file tree Collapse file tree 7 files changed +66
-49
lines changed Original file line number Diff line number Diff line change 12
12
}
13
13
],
14
14
"require" : {
15
- "infinityloop-dev/graphpinator" : " ^1.0-rc12 " ,
15
+ "infinityloop-dev/graphpinator" : " ^1.0-rc13 " ,
16
16
"infinityloop-dev/utils" : " ^2.1.2" ,
17
17
"nette/utils" : " ^3.2"
18
18
},
Original file line number Diff line number Diff line change @@ -70,18 +70,18 @@ protected function specificValidateVariance(
70
70
\Graphpinator \Value \ArgumentValueSet $ smallerSet ,
71
71
) : void
72
72
{
73
- $ lhs = $ biggerSet ->getRawValues ();
74
- $ rhs = $ smallerSet ->getRawValues ();
73
+ $ lhs = $ biggerSet ->getValuesForResolver ();
74
+ $ rhs = $ smallerSet ->getValuesForResolver ();
75
75
76
- if (\is_float ($ lhs-> min ) && ($ rhs-> min === null || $ rhs-> min < $ lhs-> min )) {
76
+ if (\is_float ($ lhs[ ' min ' ] ) && ($ rhs[ ' min ' ] === null || $ rhs[ ' min ' ] < $ lhs[ ' min ' ] )) {
77
77
throw new \Exception ();
78
78
}
79
79
80
- if (\is_float ($ lhs-> max ) && ($ rhs-> max === null || $ rhs-> max > $ lhs-> max )) {
80
+ if (\is_float ($ lhs[ ' max ' ] ) && ($ rhs[ ' max ' ] === null || $ rhs[ ' max ' ] > $ lhs[ ' max ' ] )) {
81
81
throw new \Exception ();
82
82
}
83
83
84
- if (\is_array ($ lhs-> oneOf ) && ($ rhs-> oneOf === null || !self ::varianceValidateOneOf ($ lhs-> oneOf , $ rhs-> oneOf ))) {
84
+ if (\is_array ($ lhs[ ' oneOf ' ] ) && ($ rhs[ ' oneOf ' ] === null || !self ::varianceValidateOneOf ($ lhs[ ' oneOf ' ] , $ rhs[ ' oneOf ' ] ))) {
85
85
throw new \Exception ();
86
86
}
87
87
}
Original file line number Diff line number Diff line change @@ -70,18 +70,18 @@ protected function specificValidateVariance(
70
70
\Graphpinator \Value \ArgumentValueSet $ smallerSet ,
71
71
) : void
72
72
{
73
- $ lhs = $ biggerSet ->getRawValues ();
74
- $ rhs = $ smallerSet ->getRawValues ();
73
+ $ lhs = $ biggerSet ->getValuesForResolver ();
74
+ $ rhs = $ smallerSet ->getValuesForResolver ();
75
75
76
- if (\is_int ($ lhs-> min ) && ($ rhs-> min === null || $ rhs-> min < $ lhs-> min )) {
76
+ if (\is_int ($ lhs[ ' min ' ] ) && ($ rhs[ ' min ' ] === null || $ rhs[ ' min ' ] < $ lhs[ ' min ' ] )) {
77
77
throw new \Exception ();
78
78
}
79
79
80
- if (\is_int ($ lhs-> max ) && ($ rhs-> max === null || $ rhs-> max > $ lhs-> max )) {
80
+ if (\is_int ($ lhs[ ' max ' ] ) && ($ rhs[ ' max ' ] === null || $ rhs[ ' max ' ] > $ lhs[ ' max ' ] )) {
81
81
throw new \Exception ();
82
82
}
83
83
84
- if (\is_array ($ lhs-> oneOf ) && ($ rhs-> oneOf === null || !self ::varianceValidateOneOf ($ lhs-> oneOf , $ rhs-> oneOf ))) {
84
+ if (\is_array ($ lhs[ ' oneOf ' ] ) && ($ rhs[ ' oneOf ' ] === null || !self ::varianceValidateOneOf ($ lhs[ ' oneOf ' ] , $ rhs[ ' oneOf ' ] ))) {
85
85
throw new \Exception ();
86
86
}
87
87
}
Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ protected function specificValidateVariance(
50
50
) : void
51
51
{
52
52
self ::recursiveSpecificValidateVariance (
53
- $ biggerSet ->getRawValues (),
54
- $ smallerSet ->getRawValues (),
53
+ ( object ) $ biggerSet ->getValuesForResolver (),
54
+ ( object ) $ smallerSet ->getValuesForResolver (),
55
55
);
56
56
}
57
57
Original file line number Diff line number Diff line change @@ -90,22 +90,22 @@ protected function specificValidateVariance(
90
90
\Graphpinator \Value \ArgumentValueSet $ smallerSet ,
91
91
) : void
92
92
{
93
- $ lhs = $ biggerSet ->getRawValues ();
94
- $ rhs = $ smallerSet ->getRawValues ();
93
+ $ lhs = $ biggerSet ->getValuesForResolver ();
94
+ $ rhs = $ smallerSet ->getValuesForResolver ();
95
95
96
- if (\is_int ($ lhs-> minLength ) && ($ rhs-> minLength === null || $ rhs-> minLength < $ lhs-> minLength )) {
96
+ if (\is_int ($ lhs[ ' minLength ' ] ) && ($ rhs[ ' minLength ' ] === null || $ rhs[ ' minLength ' ] < $ lhs[ ' minLength ' ] )) {
97
97
throw new \Exception ();
98
98
}
99
99
100
- if (\is_int ($ lhs-> maxLength ) && ($ rhs-> maxLength === null || $ rhs-> maxLength > $ lhs-> maxLength )) {
100
+ if (\is_int ($ lhs[ ' maxLength ' ] ) && ($ rhs[ ' maxLength ' ] === null || $ rhs[ ' maxLength ' ] > $ lhs[ ' maxLength ' ] )) {
101
101
throw new \Exception ();
102
102
}
103
103
104
- if (\is_string ($ lhs-> regex ) && ($ rhs-> regex === null || $ rhs-> regex !== $ lhs-> regex )) {
104
+ if (\is_string ($ lhs[ ' regex ' ] ) && ($ rhs[ ' regex ' ] === null || $ rhs[ ' regex ' ] !== $ lhs[ ' regex ' ] )) {
105
105
throw new \Exception ();
106
106
}
107
107
108
- if (\is_array ($ lhs-> oneOf ) && ($ rhs-> oneOf === null || !self ::varianceValidateOneOf ($ lhs-> oneOf , $ rhs-> oneOf ))) {
108
+ if (\is_array ($ lhs[ ' oneOf ' ] ) && ($ rhs[ ' oneOf ' ] === null || !self ::varianceValidateOneOf ($ lhs[ ' oneOf ' ] , $ rhs[ ' oneOf ' ] ))) {
109
109
throw new \Exception ();
110
110
}
111
111
}
Original file line number Diff line number Diff line change @@ -15,7 +15,13 @@ public function testMissingBiggerSet() : void
15
15
16
16
\assert ($ directive instanceof \Graphpinator \Directive \Directive);
17
17
18
- $ values = \Graphpinator \Value \ArgumentValueSet::fromRaw ([], $ directive ->getArguments ());
18
+ $ values = new \Graphpinator \Value \ArgumentValueSet (
19
+ (array ) \Graphpinator \Value \ConvertRawValueVisitor::convertArgumentSet (
20
+ $ directive ->getArguments (),
21
+ new \stdClass (),
22
+ new \Graphpinator \Common \Path (),
23
+ ),
24
+ );
19
25
20
26
$ directive ->validateVariance (null , $ values );
21
27
}
@@ -27,7 +33,13 @@ public function testMissingSmallerSet() : void
27
33
$ directive = TestSchema::getType ('stringConstraint ' );
28
34
\assert ($ directive instanceof \Graphpinator \Directive \Directive);
29
35
30
- $ values = \Graphpinator \Value \ArgumentValueSet::fromRaw ([], $ directive ->getArguments ());
36
+ $ values = new \Graphpinator \Value \ArgumentValueSet (
37
+ (array ) \Graphpinator \Value \ConvertRawValueVisitor::convertArgumentSet (
38
+ $ directive ->getArguments (),
39
+ new \stdClass (),
40
+ new \Graphpinator \Common \Path (),
41
+ ),
42
+ );
31
43
32
44
$ directive ->validateVariance ($ values , null );
33
45
}
You can’t perform that action at this time.
0 commit comments