starterkit-generated theme contains a weird StarterKit class

Created on 8 June 2024, 4 months ago
Updated 18 July 2024, 3 months ago

Problem/Motivation

Generating a theme with the generate-theme command results in a weird class in web/themes/custom/MYTHEME/src/StarterKit.php:

<?php

namespace Drupal\starterkit_theme;

use Drupal\Component\Serialization\Yaml;
use Drupal\Core\Theme\StarterKitInterface;

final class StarterKit implements StarterKitInterface {

  /**
   * {@inheritdoc}
   */
  public static function postProcess(string $working_dir, string $machine_name, string $theme_name): void {
    $info_file = "$working_dir/$machine_name.info.yml";
    $info = Yaml::decode(file_get_contents($info_file));
    unset($info['hidden']);
    file_put_contents($info_file, Yaml::encode($info));
  }

}

The namespace is wrong for the theme, so it's not going to get autoloaded.

And the classname is not referenced anywhere else in the code.

This just looks like something that's getting put here by mistake.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Closed: cannot reproduce

Version

11.0 🔥

Component
Base 

Last updated about 2 hours ago

Created by

🇬🇧United Kingdom joachim

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

Comments & Activities

Production build 0.71.5 2024