Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CodeExporter.php

function CodeExporter::constants

File

vendor/sebastian/global-state/src/CodeExporter.php, line 21

Class

CodeExporter

Namespace

SebastianBergmann\GlobalState

Code

public function constants(Snapshot $snapshot) : string {
    $result = '';
    foreach ($snapshot->constants() as $name => $value) {
        $result .= sprintf('if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, $this->exportVariable($value));
    }
    return $result;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal