Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Feature/return type will change #94

Open
wants to merge 4 commits into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the dvf repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check coding standards for dvf module
uses: docker://hussainweb/drupalqa:php7.4
with:
Expand Down
3 changes: 1 addition & 2 deletions dvf.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ name: Data Visualisation Framework
description: 'Data Visualisation Framework makes it easy to generate visualisations from different data sources.'
type: module
package: Data Visualisation Framework
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^9 || ^10
2 changes: 1 addition & 1 deletion src/Plugin/Field/FieldWidget/VisualisationFileWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
'#options' => $this->getVisualisationStyleOptions(),
'#empty_option' => $this->t('- Select -'),
'#empty_value' => '',
'#default_value' => isset($items[$delta]->options['visualisation_style']) ? $items[$delta]->options['visualisation_style'] : '',
'#default_value' => $items[$delta]->options['visualisation_style'] ?? '',
'#required' => $element['#required'],
'#ajax' => [
'callback' => [$this, 'updateVisualisationOptions'],
Expand Down
4 changes: 2 additions & 2 deletions src/Plugin/Field/FieldWidget/VisualisationUrlWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
'#type' => 'url',
'#title' => $this->t('URL'),
'#description' => $this->t('External url to dataset.'),
'#default_value' => isset($items[$delta]->uri) ? $items[$delta]->uri : NULL,
'#default_value' => $items[$delta]->uri ?? NULL,
'#maxlength' => 2048,
'#required' => $element['#required'],
];
Expand All @@ -52,7 +52,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
'#options' => $this->getVisualisationStyleOptions(),
'#empty_option' => $this->t('- Select -'),
'#empty_value' => '',
'#default_value' => isset($items[$delta]->options['visualisation_style']) ? $items[$delta]->options['visualisation_style'] : '',
'#default_value' => $items[$delta]->options['visualisation_style'] ?? '',
'#required' => $element['#required'],
'#ajax' => [
'callback' => [$this, 'updateVisualisationOptions'],
Expand Down
5 changes: 5 additions & 0 deletions src/Plugin/Visualisation/Source/VisualisationSourceBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,34 +186,39 @@ public function current() {
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function next() {
$this->getIterator()->next();
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function key() {
return $this->getIterator()->key();
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function valid() {
return $this->getIterator()->valid();
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function rewind() {
$this->getIterator()->rewind();
}

/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function count() {
$iterator = $this->getIterator();
return ($iterator instanceof \Countable) ? $iterator->count() : iterator_count($this->initializeIterator());
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Visualisation/VisualisationBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function __construct(
$this->source = $configuration['source'];
$this->style = $configuration['style'];
$this->moduleHandler = $module_handler;
$this->entity = isset($configuration['entity']) ? $configuration['entity'] : NULL;
$this->entity = $configuration['entity'] ?? NULL;
$this->themeManager = $themeManager;
}

Expand Down