You are here

protected function DeprecationAnalyser::createModifiedNeonFile in Upgrade Status 8

Creates the final config file in the temporary directory.

Return value

bool

1 call to DeprecationAnalyser::createModifiedNeonFile()
DeprecationAnalyser::__construct in src/DeprecationAnalyser.php
Constructs a \Drupal\upgrade_status\DeprecationAnalyser.

File

src/DeprecationAnalyser.php, line 385

Class

DeprecationAnalyser

Namespace

Drupal\upgrade_status

Code

protected function createModifiedNeonFile() {
  $module_path = drupal_get_path('module', 'upgrade_status');
  $unmodified_neon_file = DRUPAL_ROOT . "/{$module_path}/deprecation_testing.neon";
  $config = file_get_contents($unmodified_neon_file);
  $neon = Neon::decode($config);
  $neon['parameters']['tmpDir'] = $this->upgradeStatusTemporaryDirectory . '/phpstan';
  $success = file_put_contents($this->phpstanNeonPath, Neon::encode($neon), Neon::BLOCK);
  if (!$success) {
    $this->logger
      ->error($this
      ->t("Couldn't write configuration for PHPStan: @file.", [
      '@file' => $this->phpstanNeonPath,
    ]));
  }
  return $success ? TRUE : FALSE;
}