Fix methods that should return a value but do not

Created on 2 March 2024, 7 months ago
Updated 6 August 2024, about 2 months ago

Problem/Motivation

When we enabled Drupal.org's GitLab CI support in commit 36847a0, it started running PHPStan on the code.

PHPStan has pointed out some functions that should return values but do not:

  1. Function sitemap_book_title_update() should return string but return statement is missing in sitemap.install (1 instance)
  2. Method Drupal\sitemap\Plugin\Derivative\BookSitemapDeriver::create() should return static(Drupal\sitemap\Plugin\Derivative\BookSitemapDeriver) but return statement is missing in src/Plugin/Derivative/BookSitemapDeriver.php (1 instance)

Proposed resolution

Fix these problems. Remove them from phpstan-baseline.neon.

Remaining tasks

  1. See 📌 Drupal 11 compatibility fixes for sitemap Fixed

User interface changes

None.

API changes

None.

Data model changes

None.

📌 Task
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇨🇦Canada mparker17 UTC-4

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mparker17
  • Status changed to Closed: duplicate about 2 months ago
  • 🇨🇦Canada mparker17 UTC-4
    1. Function sitemap_book_title_update() should return string but return statement is missing in sitemap.install (1 instance)
    2. Method Drupal\sitemap\Plugin\Derivative\BookSitemapDeriver::create() should return static(Drupal\sitemap\Plugin\Derivative\BookSitemapDeriver) but return statement is missing in src/Plugin/Derivative/BookSitemapDeriver.php (1 instance)

    These were both done in 📌 Drupal 11 compatibility fixes for sitemap Fixed so I'm closing this as a duplicate of that one.

Production build 0.71.5 2024