Skip to content
Snippets Groups Projects
Commit 69fce6fb authored by Al Munnings's avatar Al Munnings
Browse files

Breath as fresh as a sweet summer ham. splat a fn and remove a magic __get

parent 31778a37
Branches
Tags
No related merge requests found
Pipeline #67990 passed
......@@ -86,7 +86,7 @@ class FieldProducerPlugin extends DataProducerPluginBase implements FieldProduce
return $plugin->resolveFieldItem($item, $context);
}
return $item->{$plugin->producerProperty ?? 'value'};
return $item->get($plugin->producerProperty ?? 'value')->getValue();
}
}
......@@ -28,7 +28,7 @@ class TableFieldItem extends GraphQLComposeFieldTypeBase implements FieldProduce
public function resolveFieldItem(FieldItemInterface $item, FieldContext $context) {
// Strip caption from value.
$values = array_filter($item->value, fn($k) => is_numeric($k), ARRAY_FILTER_USE_KEY);
$values = array_filter($item->value, is_numeric(...), ARRAY_FILTER_USE_KEY);
$rows = [];
......@@ -36,7 +36,7 @@ class TableFieldItem extends GraphQLComposeFieldTypeBase implements FieldProduce
foreach ($values as $value) {
$rows[] = [
'weight' => $value['weight'] ?? 0,
'data' => array_filter($value, fn($k) => is_numeric($k), ARRAY_FILTER_USE_KEY),
'data' => array_filter($value, is_numeric(...), ARRAY_FILTER_USE_KEY),
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment