File tree Expand file tree Collapse file tree 5 files changed +16
-14
lines changed
Expand file tree Collapse file tree 5 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,12 @@ jobs:
2424 - uses : actions/checkout@v2
2525
2626 - name : Install PHP
27- uses : shivammathur/setup-php@2.9.0
27+ uses : shivammathur/setup-php@2.18.1
2828 with :
2929 php-version : ${{ matrix.php }}
3030 coverage : none
3131 extensions : json, mbstring
32+
3233 - name : Get Composer Cache Directory
3334 id : composer-cache
3435 run : echo "::set-output name=dir::$(composer config cache-files-dir)"
Original file line number Diff line number Diff line change 22
33#### Unreleased
44
5+ #### 14.11.6
6+
7+ Fixed:
8+ - Fix validation of modified sparse ASTs
9+
510#### 14.11.5
611
712Fixed:
Original file line number Diff line number Diff line change 3737 "sort-packages" : true ,
3838 "allow-plugins" : {
3939 "dealerdirect/phpcodesniffer-composer-installer" : true ,
40- "phpstan/extension-installer" : true
40+ "phpstan/extension-installer" : true ,
41+ "ergebnis/composer-normalize" : true
4142 }
4243 },
4344 "autoload" : {
Original file line number Diff line number Diff line change @@ -580,11 +580,6 @@ parameters:
580580 count : 1
581581 path : src/Validator/ValidationContext.php
582582
583- -
584- message : " #^Only booleans are allowed in an if condition, GraphQL\\\\ Language\\\\ AST\\\\ SelectionSetNode\\ |null given\\ .$#"
585- count : 1
586- path : src/Validator/ValidationContext.php
587-
588583 -
589584 message : " #^Only booleans are allowed in a negated boolean, array\\ <GraphQL\\\\ Language\\\\ AST\\\\ FragmentDefinitionNode\\ > given\\ .$#"
590585 count : 1
Original file line number Diff line number Diff line change 3131use SplObjectStorage ;
3232use function array_merge ;
3333use function array_pop ;
34+ use function assert ;
3435use function count ;
3536
3637/**
@@ -180,16 +181,15 @@ public function getFragmentSpreads(HasSelectionSet $node) : array
180181 while (count ($ setsToVisit ) > 0 ) {
181182 $ set = array_pop ($ setsToVisit );
182183
183- for ($ i = 0 , $ selectionCount = count ($ set ->selections ); $ i < $ selectionCount ; $ i ++) {
184- $ selection = $ set ->selections [$ i ];
184+ foreach ($ set ->selections as $ selection ) {
185185 if ($ selection instanceof FragmentSpreadNode) {
186186 $ spreads [] = $ selection ;
187- } elseif ($ selection instanceof FieldNode || $ selection instanceof InlineFragmentNode) {
188- if ($ selection ->selectionSet ) {
189- $ setsToVisit [] = $ selection ->selectionSet ;
190- }
191187 } else {
192- throw InvariantViolation::shouldNotHappen ();
188+ assert ($ selection instanceof FieldNode || $ selection instanceof InlineFragmentNode);
189+ $ selectionSet = $ selection ->selectionSet ;
190+ if ($ selectionSet !== null ) {
191+ $ setsToVisit [] = $ selectionSet ;
192+ }
193193 }
194194 }
195195 }
You can’t perform that action at this time.
0 commit comments