Skip to content

Commit 6c78110

Browse files
committed
Include theme-settings.php
Fixes #108
1 parent 5ac172a commit 6c78110

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Drupal/DrupalAutoloader.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ public function register(Container $container): void
133133
}
134134
foreach ($this->themeData as $extension) {
135135
$this->loadExtension($extension);
136+
$theme_dir = $this->drupalRoot . '/' . $extension->getPath();
137+
$theme_settings_file = $theme_dir . '/theme-settings.php';
138+
if (file_exists($theme_settings_file)) {
139+
$this->loadAndCatchErrors($theme_settings_file);
140+
}
136141
}
137142

138143
if (class_exists(\Drush\Drush::class)) {

tests/src/DrupalIntegrationTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,9 @@ public function testAppRootPseudoService() {
6666
$errors = $this->runAnalyze(__DIR__ . '/../fixtures/drupal/modules/phpstan_fixtures/src/AppRootParameter.php');
6767
$this->assertCount(0, $errors, var_export($errors, TRUE));
6868
}
69+
70+
public function testThemeSettingsFile() {
71+
$errors = $this->runAnalyze(__DIR__ . '/../fixtures/drupal/core/modules/system/tests/themes/test_theme_settings/theme-settings.php');
72+
$this->assertCount(0, $errors, var_export($errors, TRUE));
73+
}
6974
}

0 commit comments

Comments
 (0)