Skip to content

Commit bcd4ba1

Browse files
authored
Merge pull request #111 from mglaman/gh-108
Include theme-settings.php
2 parents 5ac172a + 2b29184 commit bcd4ba1

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ before_install:
88
- composer global require "hirak/prestissimo:^0.3"
99
install:
1010
- composer install --no-interaction
11-
- composer create-project drupal-composer/drupal-project:8.x-dev $TRAVIS_BUILD_DIR/../drupal --no-interaction --no-progress
11+
- COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal-composer/drupal-project:8.x-dev $TRAVIS_BUILD_DIR/../drupal --no-interaction --no-progress
1212
script:
1313
# Inspections
1414
- ./vendor/bin/phpcs src

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)