You are here

public static function InformationHeaders::Extend in Auth0 Single Sign On 8.2

Extend an existing InformationHeaders object. Used in dependant modules to set a new SDK name and version but keep existing PHP SDK data.

Parameters

InformationHeaders $headers InformationHeaders object to extend.:

Return value

InformationHeaders

2 calls to InformationHeaders::Extend()
AuthHelper::setTelemetry in src/Util/AuthHelper.php
Extend Auth0 PHP SDK telemetry to report for Drupal.
InformationHeadersExtendTest::setExtendedHeaders in vendor/auth0/auth0-php/tests/API/Helpers/InformationHeadersExtendTest.php
Reset and extend telemetry headers.

File

vendor/auth0/auth0-php/src/API/Helpers/InformationHeaders.php, line 103

Class

InformationHeaders
Class InformationHeaders Builds, extends, modifies, and formats SDK telemetry data.

Namespace

Auth0\SDK\API\Helpers

Code

public static function Extend(InformationHeaders $headers) {
  $new_headers = new InformationHeaders();
  $old_headers = $headers
    ->get();
  if (!empty($old_headers['env']) && is_array($old_headers['env'])) {
    $new_headers
      ->setEnvironmentData($old_headers['env']);
  }
  $new_headers
    ->setEnvProperty($old_headers['name'], $old_headers['version']);
  return $new_headers;
}