src/GraphQL/Type/InterfaceType.php 1 location
|
@@ 54-60 (lines=7) @@
|
51 |
|
'type' => $type, |
52 |
|
]; |
53 |
|
|
54 |
|
uasort($this->types, function (array $a, array $b) { |
55 |
|
if ($a['weight'] === $b['weight']) { |
56 |
|
return 0; |
57 |
|
} |
58 |
|
|
59 |
|
return ($a['weight'] < $b['weight']) ? 1 : -1; |
60 |
|
}); |
61 |
|
} |
62 |
|
|
63 |
|
/** |
src/Plugin/GraphQL/PluggableSchemaBuilder.php 1 location
|
@@ 100-106 (lines=7) @@
|
97 |
|
} |
98 |
|
|
99 |
|
// Sort the plugins so that the ones with higher weight come first. |
100 |
|
usort($items, function (array $a, array $b) { |
101 |
|
if ($a['weight'] === $b['weight']) { |
102 |
|
return 0; |
103 |
|
} |
104 |
|
|
105 |
|
return ($a['weight'] < $b['weight']) ? 1 : -1; |
106 |
|
}); |
107 |
|
|
108 |
|
return array_map(function (array $item) { |
109 |
|
return $this->getInstance($item['type'], $item['id']); |