SU-SWS/stanford_fields

View on GitHub
src/Plugin/views/display/ViewFieldBlock.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php
 
namespace Drupal\stanford_fields\Plugin\views\display;
 
use Drupal\Core\StringTranslation\TranslatableMarkup;
Unused use statement
use Drupal\views\Attribute\ViewsDisplay;
use Drupal\views\Plugin\views\display\Block;
 
/**
* The plugin that handles a block.
*
* @ingroup views_display_plugins
*
* @see \Drupal\views\Plugin\Block\ViewsBlock
* @see \Drupal\views\Plugin\Derivative\ViewsBlock
*/
Perl-style comments are not allowed; use "// Comment" instead
#[ViewsDisplay(
`syntax error, unexpected ','`
Line indented incorrectly; expected 0 spaces, found 2
id: "viewfield_block",
title: new TranslatableMarkup("View Field Block"),
admin: new TranslatableMarkup("Block"),
help: new TranslatableMarkup("Identical to a block, but allows for granular viewfield settings."),
theme: "views_view",
contextual_links_locations: ["block"],
register_theme: FALSE,
uses_hook_block: TRUE,
)]
Missing class doc comment
class ViewFieldBlock extends Block {
 
/**
Doc comment short description must end with a full stop
Doc comment short description must start with a capital letter
* {@inheritDoc}
*/
public function optionsSummary(&$categories, &$options) {
parent::optionsSummary($categories, $options);
$categories['block']['title'] = $this->t('Field Block Settings');
$options['block_description']['title'] = $this->t('Field Block Name');
$options['block_category']['title'] = $this->t('Field Block Category');
}
 
}