Skip to content
Snippets Groups Projects
Commit 8673c30a authored by Peter Wolanin's avatar Peter Wolanin Committed by Peter Wolanin
Browse files

Issue #3338660 by pwolanin, kdebisschop: PHP 8 and more Drupal 10 fixes

parent 3ff7d0bb
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,6 @@
"require": {
"ext-json": "*",
"php": ">=7.4",
"drupal/csv_serialization": "^1.0 || ^2.0"
"drupal/csv_serialization": "^2.0 || ^3.0"
}
}
......@@ -179,7 +179,7 @@ class StreamingDataExport extends PathPluginBase implements StreamingDisplayInte
// Query plugins allow specifying a specific query class per base table.
$views_data = Views::viewsData()->get($this->view->storage->get('base_table'));
$name = isset($views_data['table']['base']['query_id']) ? $views_data['table']['base']['query_id'] : 'views_query';
$name = $views_data['table']['base']['query_id'] ?? 'views_query';
// Substitute the SQL plugin.
if ($name === 'views_query') {
$name = 'streaming_sql_query';
......@@ -494,12 +494,15 @@ class StreamingDataExport extends PathPluginBase implements StreamingDisplayInte
*
* @return bool
* TRUE, when the view should override the given route.
*
* @see \Drupal\rest\Plugin\views\display\RestExport::overrideApplies()
*/
protected function overrideApplies($view_path, Route $view_route, Route $route) {
$route_formats = explode('|', $route->getRequirement('_format'));
$view_route_formats = explode('|', $view_route->getRequirement('_format'));
$route_has_format = $route->hasRequirement('_format');
$route_formats = $route_has_format ? explode('|', $route->getRequirement('_format')) : [];
$view_route_formats = $view_route->hasRequirement('_format') ? explode('|', $view_route->getRequirement('_format')) : [];
return $this->overrideAppliesPathAndMethod($view_path, $view_route, $route)
&& (!$route->hasRequirement('_format') || array_intersect($route_formats, $view_route_formats) !== []);
&& (!$route_has_format || array_intersect($route_formats, $view_route_formats) !== []);
}
/**
......@@ -588,9 +591,7 @@ class StreamingDataExport extends PathPluginBase implements StreamingDisplayInte
// During the update path the provider options might be wrong. This can
// happen when any update function, like block_update_8300() triggers a
// view to be saved.
return isset($this->authenticationProviderIds[$provider])
? $this->authenticationProviderIds[$provider]
: NULL;
return $this->authenticationProviderIds[$provider] ?? NULL;
}, $this->getOption('auth'))));
return $dependencies;
......
......@@ -85,7 +85,7 @@ class StreamingViewExecutable extends ViewExecutable implements \IteratorAggrega
return TRUE;
}
// Don't allow to use deactivated displays, but display them on the live preview.
// Don't allow deactivated displays, but display them on the live preview.
if (!$this->display_handler->isEnabled() && empty($this->live_preview)) {
$this->build_info['fail'] = TRUE;
return FALSE;
......@@ -111,7 +111,7 @@ class StreamingViewExecutable extends ViewExecutable implements \IteratorAggrega
*
* @throws \ReflectionException
*/
public function getIterator() {
public function getIterator(): \Traversable {
$i = 0;
$chunk_size = $this->display_handler->getOption('chunk_size') ?: StreamingDisplayInterface::DEFAULT_CHUNK_SIZE;
do {
......
......@@ -20,7 +20,7 @@ trait ExportTestTrait {
/**
* Setup for the test.
*/
public function setUp() {
protected function setUp(): void {
parent::setUp();
$this->installConfig(['system', 'text', 'filter']);
$this->installConfig(self::$modules);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment