Skip to content
Merged
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
1 change: 0 additions & 1 deletion config/install/views.view.localgov_blog_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ display:
default_argument_type: fixed
default_argument_options:
argument: ''
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
Expand Down
1 change: 0 additions & 1 deletion config/install/views.view.recent_blogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ display:
title: ''
default_argument_type: node
default_argument_options: { }
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
Expand Down
2 changes: 1 addition & 1 deletion localgov_blogs.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'LocalGov Blogs'
description: Provides blog channel and blog post content types with related views for LocalGov Drupal.
core_version_requirement: ^9 || ^10
core_version_requirement: ^10 || ^11
type: module
package: LocalGov Drupal

Expand Down
4 changes: 2 additions & 2 deletions localgov_blogs.install
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use Symfony\Component\Yaml\Yaml;
/**
* Implements hook_install().
*/
function localgov_blogs_install($is_syncing) {
function localgov_blogs_install($is_syncing): void {
// Configure scheduled transitions if enabled.
if (!$is_syncing && \Drupal::moduleHandler()->moduleExists('scheduled_transitions')) {
localgov_blogs_configure_scheduled_transitions();
Expand All @@ -21,7 +21,7 @@ function localgov_blogs_install($is_syncing) {
/**
* Add the new view for blog authors.
*/
function localgov_blogs_update_8001() {
function localgov_blogs_update_8001(): void {

$views_view_localgov_blog_authors_yml = <<<EOY
langcode: en
Expand Down
16 changes: 8 additions & 8 deletions localgov_blogs.module
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use Drupal\views\Views;
/**
* Implements hook_theme().
*/
function localgov_blogs_theme($existing, $type, $theme, $path) {
function localgov_blogs_theme($existing, $type, $theme, $path): array {
return [
'localgov_blogs_prev_next_block' => [
'variables' => [
Expand All @@ -33,7 +33,7 @@ function localgov_blogs_theme($existing, $type, $theme, $path) {
/**
* Implements hook_modules_installed().
*/
function localgov_blogs_modules_installed($modules, $is_syncing) {
function localgov_blogs_modules_installed($modules, $is_syncing): void {

// Configure scheduled transitions if it's being installed.
if (in_array('scheduled_transitions', $modules, TRUE)) {
Expand All @@ -44,7 +44,7 @@ function localgov_blogs_modules_installed($modules, $is_syncing) {
/**
* Implements hook_entity_extra_field_info().
*/
function localgov_blogs_entity_extra_field_info() {
function localgov_blogs_entity_extra_field_info(): array {
$fields = [];

// Add a blog listing field to blog channels.
Expand All @@ -69,7 +69,7 @@ function localgov_blogs_entity_extra_field_info() {
/**
* Implements hook_ENTITY_TYPE_view() for node entities.
*/
function localgov_blogs_node_view(array &$build, NodeInterface $node, EntityViewDisplayInterface $display, $view_mode) {
function localgov_blogs_node_view(array &$build, NodeInterface $node, EntityViewDisplayInterface $display, $view_mode): void {

// Add the blog listing view to blog channels.
if ($display->getComponent('localgov_blog_listing')) {
Expand All @@ -92,7 +92,7 @@ function localgov_blogs_node_view(array &$build, NodeInterface $node, EntityView
/**
* Implements hook_form_alter().
*/
function localgov_blogs_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function localgov_blogs_form_alter(&$form, FormStateInterface $form_state, $form_id): void {

// Add promote to channel field to blog posts.
if (
Expand Down Expand Up @@ -129,7 +129,7 @@ function localgov_blogs_form_alter(&$form, FormStateInterface $form_state, $form
/**
* Custom submit handler for localgov_blog_channel_promote field.
*/
function localgov_blogs_blog_channel_promote_submit(array $form, FormStateInterface $form_state) {
function localgov_blogs_blog_channel_promote_submit(array $form, FormStateInterface $form_state): void {

if (
$form_state->getFormObject() instanceof NodeForm &&
Expand Down Expand Up @@ -163,7 +163,7 @@ function localgov_blogs_blog_channel_promote_submit(array $form, FormStateInterf
/**
* Implements hook_field_widget_complete_form_alter().
*/
function localgov_blogs_field_widget_complete_form_alter(&$field_widget_complete_form, FormStateInterface $form_state, $context) {
function localgov_blogs_field_widget_complete_form_alter(&$field_widget_complete_form, FormStateInterface $form_state, $context): void {

// Check the blog channel select options.
$field_definition = $context['items']->getFieldDefinition();
Expand Down Expand Up @@ -279,7 +279,7 @@ function localgov_blogs_localgov_roles_default(): array {
/**
* Configure scheduled transitions.
*/
function localgov_blogs_configure_scheduled_transitions() {
function localgov_blogs_configure_scheduled_transitions(): void {
// Configure scheduled transitions for alert banners.
$scheduled_transitions_config = \Drupal::service('config.factory')->getEditable('scheduled_transitions.settings');
$bundles = $scheduled_transitions_config->get('bundles');
Expand Down
4 changes: 2 additions & 2 deletions src/EventSubscriber/PageHeaderSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PageHeaderSubscriber implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
public static function getSubscribedEvents(): array {
return [
PageHeaderDisplayEvent::EVENT_NAME => ['setPageHeader', 0],
];
Expand All @@ -25,7 +25,7 @@ public static function getSubscribedEvents() {
/**
* Hide page header block.
*/
public function setPageHeader(PageHeaderDisplayEvent $event) {
public function setPageHeader(PageHeaderDisplayEvent $event): void {
if ($event->getEntity() instanceof Node &&
($event->getEntity()->bundle() == 'localgov_blog_post')
) {
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/BlogCreationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function setUp(): void {
/**
* Test the blog post create form.
*/
public function testBlogChannelSelection() {
public function testBlogChannelSelection(): void {

// Check no blog channel message.
$this->drupalGet('/node/add/localgov_blog_post');
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Functional/PrevNextBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function setUp(): void {
/**
* Test the Previous / Next Navigation block.
*/
public function testPrevNextBlock() {
public function testPrevNextBlock(): void {

// Create channel_one.
$channel_one = $this->createNode([
Expand Down Expand Up @@ -121,7 +121,7 @@ public function testPrevNextBlock() {
/**
* Test the correct next / prev posts appear when all the same date.
*/
public function testPrevNextWithSameDate() {
public function testPrevNextWithSameDate(): void {

// Create a channel.
$channel = $this->createNode([
Expand Down